title: Matching URL with wildcards
body: <p>I'm trying to match URLs with wildcards in them to actual URLs. For example:</p>
  
  <pre><code>http://*google.com/*
  </code></pre>
  
  <p>Needs to match</p>
  
  <pre><code>http://maps.google.com
  </code></pre>
  
  <p>And</p>
  
  <pre><code>http://www.google.com/maps
  </code></pre>
  
  <p>What would be the best way of going about this?</p>
  
  <p>I've tried using a regular expression and that works fine when I manually program it but I'm not sure whether it's possible to dynamically generate regular expressions or if that would be the best practice in this situation.</p>
  
  <pre><code>/(http|https):\/\/.*\.?google\.com\/?.*/i
  </code></pre>
  
  <p>Thanks very much.</p>