I need to detect whether a string contains HTML tags.
if(!preg_match(\'(?<=<)\\w+(?=[^<]*?>)\', $string)){ return $string; }
you need to 'delimit' the regex with some character or another. Try this:
if(!preg_match('#(?<=<)\w+(?=[^<]*?>)#', $string)){ return $string; }