title: How can I make jQuery location.search work more efficiently with a regex?
body: <p>So, I've got some jQuery code that's hiding the ".toggle-featured" div (Featured section) on any page other than the blog index pages of this site (in development), for example: <a href="http://sabq-dev.squarespace.com/experts/" rel="nofollow">http://sabq-dev.squarespace.com/experts/</a></p>
  
  <p>It works fine, but I know there's got to be a better way to achieve the same result with less redundant js.</p>
  
  <p>Here's an example of what I've got currently:</p>
  
  <pre><code>(function($){
  
  if(location.search == "?category=Creativity-Intelligence"){
    $('.toggle-featured').hide();
  }
  
  })(jQuery);
  </code></pre>
  
  <p>Then I'm repeating this for each category query (10 more which constitute the links in the Filter Categories navigation bar and are the same for every blog section), when I believe that all I really need is the correct regex to have the script find any query prepended with "?=category" and then hide the ".toggle-featured" div. Hopefully that makes sense?</p>
  
  <p>Thus far, all my reading up on regular expressions has gotten me nowhere and I'm sure it's something relatively simple, but for the life of me I can't seem to figure it out.</p>
  
  <p>Any ideas would be greatly appreciated</p>
  
  <p>Thanks!</p>