I have this piece of HTML:
</TABLE>
<HR>
<font size="+1"> Method and apparatus for re-sizing and zooming images by operating directly
on their digital transforms
</font><BR>
and I am trying to capture the text inside font tag. This is my Regex:
Regex regex = new Regex("</TABLE><HR><font size=\"+1\">(?<title>.*?)</font><BR>", RegexOptions.Singleline | RegexOptions.IgnoreCase);
Match match = regex.Match(data);
string title = match.Groups["title"].Value;
However I get empty title. Can anybody tell me what am I missing?
Your regex;
isn’t well formed since
+has a distinct meaning in regex.Based on your input string, what you want is really to have it escaped;
Also, if you want to match strings with newlines, you have to give a wildcard to ignore them too, so this may be even more what you’re trying to do;