Created
July 10, 2012 21:15
-
-
Save Dottenpixel/3086273 to your computer and use it in GitHub Desktop.
RegEx that reliably tests for a valid URL
This file contains 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
/^((http|https|ftp):\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/ix |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment