using System.Text.RegularExpressions;
public static void Main()
string text = @"[配送日時指定:]
string pat=@"\[(.*?)[:]\](\s)";
Regex r = new Regex(pat, RegexOptions.IgnoreCase);
for (int i = 1; i <= 1; i++)
CaptureCollection cc = g.Captures;
var strLength=c.Index-c.Length-lastIndex;
strLength=strLength==-1?0:strLength;
System.Console.WriteLine("Key="+lastKey+" , Val="+text.Substring(lastIndex,strLength));
lastIndex=c.Index+c.Length+2;
if(lastIndex>0 && text.Length>lastIndex){
System.Console.WriteLine( "Key="+lastKey+" , Val="+text.Substring(lastIndex));