Last active
January 4, 2016 03:33
-
-
Save rlandas/4263107 to your computer and use it in GitHub Desktop.
Regex: Filtering files by extension(@see http://www.mkyong.com/regular-expressions/how-to-validate-image-file-extension-with-regular-expression/)works for `filename.ext` and `.extension`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(([^\s]+)?(\.(?i)(jpg|png|gif|bmp|git|phar|txt|json))$) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Taken from here: http://www.mkyong.com/regular-expressions/how-to-validate-image-file-extension-with-regular-expression/