Regex To Check If Are Allowed File Types

A regular expression to check if the files you provide are allowed file types.

It is useful in file uploaders that allow you to validate file types before uploading.

Feel free to override the regex below to add more file extensions:



  • regex.gif
  • regex.webp


  • regex.mp4
  • regex.mp3
  • regex.jiff

See Also: