title: RegExp to check if file is image
body: <p>Is there a way to know if the file extension is an image?</p>
  
  <p>i got this.</p>
  
  <pre><code>image/png
  </code></pre>
  
  <p>Already try with </p>
  
  <pre><code>var imageReg = /\.(gif|jpg|jpeg|tiff|png)$/i;
  string = "image/png"
  imageReg.test(string)
  </code></pre>
  
  <p>But this return <code>false;</code></p>