Last active
April 9, 2022 08:29
-
-
Save dmitriid/f64fa7c3a6000e0170a9d911445bc1f3 to your computer and use it in GitHub Desktop.
This file contains 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
scheme:[//[user:password@]host[:port]][/]path[?query][#fragment] | |
(file|ftp|https|http|irc|mailto):\/\/((\w+(:\w+)?@)?\w(\w\.?)*(:\d{1,5})?\/?)?(\w(\w+\/)*)?(#\w+)? | |
--- | |
scheme = (file|ftp|https|http|irc|mailto):\/\/ | |
optional username followed by optional :password. Username and password ar alphanumeric | |
| | |
v | |
user = (\w+(:\w+)?@)? | |
an alphanumeric char followed by (any number of characters optionally followed by a period) | |
| | |
v | |
host = \w(\w\.?)* | |
optional port, 1 to 5 digits | |
| | |
v | |
port = (:\d{1,5})? | |
optional (alphanumeric char followed by any number of alphanumeric characters interspereced with /) | |
| | |
v | |
path = (\w(\w+\/)*)? | |
optional characters following ?. As long as those characters are not # | |
| | |
v | |
query = (\?[^#]+)? | |
optional anything following # | |
| | |
v | |
query = (#.+)? | |
---- | |
combine together. The entirety of (user host port) is optional | |
scheme | |
(user | |
host | |
port)? | |
path | |
query | |
fragment |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment