More efficient way of searching window.location.href for a string?
<p>Is there a more efficient way of searching the window.location.href?</p>

<p>window.location.href: <code>http://www.example.com/6CATA/folder/file.html</code></p>

<p>The current code I have is:</p>

<pre><code>var searchWinHref = window.location.href;
if(searchWinHref.indexOf("/6CATA/") &gt; -1) {
  alert('6CATA is in the window.location.href');
}
</code></pre>

<p>Which works just fine, but I'm trying to learn ways to optimise code where possible and if I need to do this a couple of times on a page, I'm curious to know if there's a more efficient way to do it?</p>

<p>EDIT:</p>

<p>To clarify, I need to occasionally search the URL for different variations, e.g: 6CATA &amp; 6CATB etc.</p>
