The example I've given matches the whole string i.e. <span id="name">Inner Text</span> where as I just want the Inner Text part. I thought the brackets normally act as a separate "sub" match pattern??? This is getting very annoying!!try this
<span id="name">[^<]*
the one youve already quoted should have done it, gotta love reg expressions![]()
string text = "<span id=\"name\">Inner Text</span>";
Regex testRegex = new Regex("<span id=\"name\">(.*?)</span>");
MatchCollection matches = testRegex.Matches(text);
this.txtInfo.AppendText("Number of matches = " + matches.Count + Environment.NewLine);
foreach (Match match in matches)
{
this.txtInfo.AppendText("Matches = " + match.Value + Environment.NewLine);
}