Skip to content

Instantly share code, notes, and snippets.

@ptiswitz
Last active August 29, 2015 14:23
Show Gist options
  • Save ptiswitz/aa5dc0156c47a8517c1b to your computer and use it in GitHub Desktop.
Save ptiswitz/aa5dc0156c47a8517c1b to your computer and use it in GitHub Desktop.
Regex to catch url and extract protocol, domain, path and query string
/(?:(https?):\/\/)((?:[\w\-\.]+))([\w\/\-\._]+)?(?:\?([\w\-_=&]+))?/g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment