Skip to content

Instantly share code, notes, and snippets.

@Dottenpixel
Created July 10, 2012 21:15
Show Gist options
  • Save Dottenpixel/3086273 to your computer and use it in GitHub Desktop.
Save Dottenpixel/3086273 to your computer and use it in GitHub Desktop.
RegEx that reliably tests for a valid URL
/^((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