title: What regex would find out if file url has certain extension
body: <p>My valid urls could look more or less like this </p>
  
  <pre><code>http://someurl.com/some/path/file.pdf
  or 
  http://someurl.com/some/path/file.pdf?param=value
  or 
  http://someurl.com/some/path/file.pdf?param=value&amp;second=val
  </code></pre>
  
  <p>where the file extension could be .pdf, or some other extension like .jpg or .psd, or nothing at all.</p>
  
  <p>I have the url stored without the someurl.com portion, so it's the <code>some/path/file.pdf</code> part of the url</p>
  
  <p>How can I use regex to know the file extension if it is present? Is regex the right tool for this?</p>