title: JavaScript match against array
body: <p>I would like to know how to match a string against an array of regular expressions.<br>
  I know how to do this looping through the array.<br>
  I also know how to do this by making a long regular expression separated by |<br>
  I was hoping for a more efficient way like  </p>
  
  <pre><code>if (string contains one of the values in array) {
  </code></pre>
  
  <p>For example:  </p>
  
  <pre><code>string = "the word tree is in this sentence";  
  array[0] = "dog";  
  array[1] = "cat";  
  array[2] = "bird";  
  array[3] = "birds can fly";  
  </code></pre>
  
  <p>In the above example, the condition would be false.<br>
  However, <code>string = "She told me birds can fly and I agreed"</code> would return true.</p>