Hi There
I am scraping a year value from the innerhtml of a span and the value is in brackets like this:
<span class="year_type">(2009)</span><br>
I want to get the value of the year without the brackets but am getting some compiler errors when trying to escape the "(" char.
My pattern:
const string yearPattern = "<span class=\"year_type\">\((?<year>.*?)\)</span>";
Complete Code:
const string yearPattern = "<span class=\"year_type\">\((?<year>.*?)\)</span>";
var regex = new Regex(yearPattern, RegexOptions.Singleline | RegexOptions.IgnoreCase);
Match match = regex.Match(data);
return match.Groups["year"].Value;
What is the best way to escape the ()
Thanks