title: regex / instr javascript function to check url
body: <p>I have 8 possible URL structures that I need to check in my javascript code and then run a function if the current page meets the correct criteria.</p>
  
  <p>There are 8 possible variations of the URL and all will include the keyword questions, so the first check needs to isolate and identify if the current page has the keyword 'questions' in its structure :-</p>
  
  <ol>
  <li><p><a href="https://meta.stackexchange.com/questions">https://meta.stackexchange.com/questions</a></p></li>
  <li><p><a href="https://meta.stackexchange.com/questions/ask">https://meta.stackexchange.com/questions/ask</a></p></li>
  <li><p><a href="https://meta.stackexchange.com/questions?sort=newest">https://meta.stackexchange.com/questions?sort=newest</a></p></li>
  <li><p><a href="https://meta.stackexchange.com/questions?sort=featured">https://meta.stackexchange.com/questions?sort=featured</a></p></li>
  <li><p><a href="https://meta.stackexchange.com/questions?sort=active">https://meta.stackexchange.com/questions?sort=active</a></p></li>
  <li><p><a href="https://meta.stackexchange.com/questions?sort=votes">https://meta.stackexchange.com/questions?sort=votes</a></p></li>
  <li><p><a href="https://meta.stackexchange.com/questions?sort=hot">https://meta.stackexchange.com/questions?sort=hot</a></p></li>
  <li><p><a href="https://meta.stackexchange.com/questions/1308/urgent-help-needed-i-screwed-up-my-site-really-bad-my-realty-questions">https://meta.stackexchange.com/questions/1308/urgent-help-needed-i-screwed-up-my-site-really-bad-my-realty-questions</a></p></li>
  </ol>
  
  <p>I am only interested in the latter (URL structure8) which will always have the keyword 'questions' in the url followed by a forward slash (/) and then a number from 1 to 9.</p>
  
  <p>How can I write a js instr / regex function that can determine on page load if the page url matches the format of option 8 above.</p>
  
  <p>Hope someone can help!</p>
  
  <p>Thanks</p>
  
  <p>Jonathan</p>