title: Regex to match string in current URL including wild card
body: <p>What would be regex to match part of a URL using JavaScript and also include wildcards?</p>
  
  <p>For example:</p>
  
  <p>match all pages: <code>/pages/*</code></p>
  
  <p>match a page called about: <code>/pages/about</code></p>
  
  <p>match all products that contain the string large: <code>/products/*large*</code></p>
  
  <p><a href="https://jsbin.com/toxemanewe/1/edit?js,console,output" rel="nofollow">https://jsbin.com/toxemanewe/1/edit?js,console,output</a></p>