为什么我的匹配成功等于 false?我已经在 Regexbuddy 中测试了以下模式和输入,它是成功的。
string pattern = @"(?i)(<!-- START -->)(.*?)(?i)(<!-- END -->)";
string input = @"Hello
<!-- START -->
is there anyone out there?
<!-- END -->";
Match match = Regex.Match(input, pattern, RegexOptions.Multiline);
if (match.Success) //-- FALSE!
{
string found = match.Groups[1].Value;
Console.WriteLine(found);
}