Regex JavaScript image file extension [closed]

I need a regular expression to validate image file extensions in javascript. Do you have one ?



Could you explain the purpose?

Anyway here's one assuming you support few image types.


I have put the whole regular expression within parens () so as to disambiguate between the slash (/) operator and RegExp object. See JSLint for more details.

Here's the raw regex as well.


This Regex also assumes that you're including the dot before the extension. Remove the \. if you're not.


Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.