Created
November 21, 2016 13:23
-
-
Save enil/004b71e26ad4149fc3a407f21c27bb41 to your computer and use it in GitHub Desktop.
Simple URL parsing
This file contains hidden or 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
url.match(/^([a-z]+):\/\/([^\/:]+)(?::([0-9]+))?(\/[^?#]+)?(?:\?([^#]*))?(?:#(.+))?$/); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment