reg exp - search()
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/494035/how-do-you-pass-a-variable-to-a-regular-expression-javascript">How do you pass a variable to a Regular Expression JavaScript?</a>  </p>
</blockquote>



<p>how to write a variable into a reg exp pattern?</p>

<p>here the pattern always is /value/i</p>

<pre><code>var value = inp.val();
if(search_list[key].search(/value/i) &gt;= 0) alert('ok');
</code></pre>
