Skip to content

Instantly share code, notes, and snippets.

@cmd-save
Created August 6, 2019 15:32
Show Gist options
  • Select an option

  • Save cmd-save/a9e374ce8e1506f14d83bbb55e964fb9 to your computer and use it in GitHub Desktop.

Select an option

Save cmd-save/a9e374ce8e1506f14d83bbb55e964fb9 to your computer and use it in GitHub Desktop.
Regex for url that accepts without protocol or a sub domain
const urlReqex = /^((https?|ftp|smtp):\/\/)?(www.)?[a-z0-9]+\.([a-z].+)?[a-z]+(\/[a-zA-Z0-9#]+\/?)*$/;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment