Skip to content

Instantly share code, notes, and snippets.

@daGrevis
Last active August 29, 2015 13:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daGrevis/9762288 to your computer and use it in GitHub Desktop.
Save daGrevis/9762288 to your computer and use it in GitHub Desktop.
Will match 99% URLs
/
(?:(\w+)\:?\/\/)? # Protocol
([^\/?]+) # Optional subdomains, domain and TLD
\/? # Traling slash
([^\?]*) # Path
([^\#]*) # Query
(\#?.*) # Fragment
/xu
# http://regex101.com/r/oV5tN9
@daGrevis
Copy link
Author

99% is a made up number! 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment