I know there are tons of questions similar to this, but this is specific to my regular expression. I'm trying to see if a string has any html in it.
Regex tagRegex = new Regex(@"<\s*([^ >]+)[^>]*>.*?<\s*/\s*\1\s*>")
if(tagRegex.IsMatch(body))
{
*do something*
}
but it is failing at the IsMatch part due to catastrophic backtracking. Can anyone tell me what's the issue with the regular expression?
Thank you