我正试图对等;群体(任何短语)#date#(任何短语),但阀1和瓦尔2为空。
Console.WriteLine("Subject: "+line);
Match match = Regex.Match(line, "(.)"+Regex.Escape("##date##")+"(.)", RegexOptions.IgnoreCase);
string val1 = match.Groups[1].Value;
string val2 = match.Groups[2].Value;
Console.WriteLine("Line#{0}: {1} Date: {2}", ++lineNo, val1, val2);
Console:
Subject: http://www.website.com/url/is/masked.htm ##date## 3
Line#25: Date:
难道没有钱应该与什么相匹配?