I have matchCollection. And I need group index 1. Now I take out the data from a large number of casts, I would like to avoid it.
example: startTag = <a>
, endTag = </a>
Html = <a>texttexttext</a>
.
I need get "texttexttext" with out <a>
and </a>
var regex = new Regex(startTag + "(.*?)" + endTag, RegexOptions.IgnoreCase);
var matchCollection = regex.Matches(html);
foreach (var item in matchCollection)
{
string temp = ((Match)(((Group)(item)).Captures.SyncRoot)).Groups[1].Value;
}