Detect HTML tags in a string
<p>I need to detect whether a string contains HTML tags. </p>

<pre><code>if(!preg_match('(?&lt;=&lt;)\w+(?=[^&lt;]*?&gt;)', $string)){ 
    return $string;
}
</code></pre>

<p>The above regex gives me an error:</p>

<pre><code>preg_match() [function.preg-match]: Unknown modifier '\'
</code></pre>

<p>I'm not well up on regex so not sure what the problem was. I tried escaping the \ and it didn't do anything. </p>

<p>Is there a better solution than regex? If not, what would be the correct regex to work with the preg_match?</p>
