Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Community Library
How to contribute
x
Extract URL parts only named capturing groups
Open Workspace
Golang
Match
Created 2022-02-03 00:00
3
Regular Expression
`
^
(?P<scheme>
[^
:
\/
?#
]
+
)
:
(?:
\/\/
)?(?:
(?:
(?P<login>
[^
:
]
+
)(?:
:
(?P<password>
[^
@
]
+
)?
)?
@
)?(?P<host>
[^
@
\/
?#:
]
*
)(?:
:
(?P<port>
\d
+
)?
)?
)?(?P<path>
[^
?#
]
*
)(?:
\?
(?P<query>
[^
#
]
*
)
)?(?:
#
(?P<fragment>
.
*
)
)?
`
gm
Description
Extract URL parts only named capturing groups
Submitted by
dixanms