title: How to make regex case-insensitive?
body: <p>I have this javascript code but when i send this: asd.JPG the regex fails to me..</p>
  
  <pre><code>if (data.match(/([^\/\\]+)\.(jpg|jpeg|gif|png|tiff|tif)$/i))
       return { filename: RegExp.$1, ext: RegExp.$2 };
  else
       return { filename: "invalid file type", ext: null };
  </code></pre>
  
  <p>So I want that the regex looks at the extension as case-insensitive.
  I tried this but it fails:</p>
  
  <pre><code>data.match(/([^\/\\]+)\.(?i)(jpg|jpeg|gif|png|tiff|tif)$/i)
  </code></pre>
  
  <p>Any Ideas?</p>