title: Regex to Match Specific URL with Query String
body: <p>Hi I'm trying to match a specific URL that allows for query strings. Basically I need the following to happen:</p>
  
  <ul>
  <li><code>http://some.test.domain.com</code> - Pass</li>
  <li><code>http://some.test.domain.com/</code> - Pass</li>
  <li><code>http://some.test.domain.com/home</code> - Pass</li>
  <li><code>http://some.test.domain.com/?id=999</code> - Pass</li>
  <li><code>http://some.test.domain.com/home?id=888&amp;rt=000</code> - Pass</li>
  <li><code>http://some.test.domain.com/other</code> - Fail</li>
  <li><code>http://some.test.domain.com/another?id=999</code> - Fail</li>
  </ul>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>var pattern = new RegExp('^(https?:\/\/some\.test\.domain\.com(\/{0,1}|\/home{0,1}))$');
  if (pattern.test(window.location.href)){
      console.log('yes');   
  }
  </code></pre>
  
  <p>The above code only works for the first three and not for the query strings. Any help would be appreciated. Thanks.</p>