title: test string against multiple regexes in javascript
body: <p>I want to test a given string against 20 or so regular expressions. What's a clean way to do this in Javascript? I'm more concerned about clean code and readability than efficiency (but I don't want it to be super slow either).</p>
  
  <p>Right now I have:</p>
  
  <pre><code>if (href.indexOf('apple.com') &gt; -1 ||
      href.indexOf('google.com') &gt; -1 ||
      href.indexOf('yahoo.com') &gt; -1 ||
      href.indexOf('facebook.com') &gt; -1) {
      performDarkMagic()
  }
  </code></pre>
  
  <p>But it's going to start looking kind of messy as that list grows. 
  Maybe I could just create an array of regular expressions and execute something like _.any() and apply regex.test on each? </p>
  
  <p>Edit: the strings/regexes to match may become more complicated, I just used simple URLs to make the example readable.</p>