Regex Options Matching Multi-line As Well As Ignoring The Case
I have some piece of ill-formed html, sometimes the ' is missing. Also, it sometimes shows capital cases while other times lower cases:
Solution 2:
You need to OR them together in this case.
const string pattern= @"<div class=""?main""?><div class=""?subsection1""?><h2><div class=""?subwithoutquote""?>(.+?)</div>";
Match m = Regex.Match(html, pattern, RegexOptions.IgnoreCase | RegexOptions.Singleline)
Edit: Change your RegEx to the following ...
const string pattern = @"<divclass="?main"?>\s*<divclass="?subsection1"?>\*+<h2>\s*<divclass="?subwithoutquote"?>(.+?)</div>
Post a Comment for "Regex Options Matching Multi-line As Well As Ignoring The Case"