Skip to content

Instantly share code, notes, and snippets.

@PatrickJS
Last active December 18, 2015 09:09
Show Gist options
  • Save PatrickJS/5759696 to your computer and use it in GitHub Desktop.
Save PatrickJS/5759696 to your computer and use it in GitHub Desktop.
Regular Expression
===========================
| Match any url |
| -------------- |
| https://www.google.com/ |
| http://gdi2290.com/ |
| ftp://s3.amazom.com/ |
| -------------- |
| /(ht|f)tps?://.+/g |
===========================
===========================
| Match file extension |
| -------------- |
| .jpeg or .jpg |
| .png or .gif |
| -------------- |
| /.+\.(jpe?g|png|gif)$/g |
===========================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment