jQuery Search for Text in a Variable?
<p>I have a variable that contains some text, some html, basically can be a string. I need to search the variable for a specific string to process that variable differently if it is contained. Here is a snippet of what I am trying to do, does not work obviously :)</p>

<p><code>
$.each(data.results,
    function(i, results) {</p>

<pre><code>var text = this.text

var pattern = new RegExp("^[SEARCHTERM]$");
    if(pattern.test( text ) )
    alert(text);  //was hoping this would alert the SEARCHTERM if found...
</code></pre>

<p></code></p>
