这是我的正则表达式:
private static Regex _errorRegex = new Regex(" <div class=\"styleRed\">(?<message>.*?)</div>", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled);
该网页的数据如下:
<div class="styleRed">• Zero is required in the Consideration Field for Deed Type CEDOT (Row 1). </div><div class="styleRed">• Zero is required in the Assume/Value Field for Deed Type CEDOT (Row 1). </div>
var matches = _errorRegex.Matches(webpage);
匹配数始终为 1。知道我错过了什么吗?