Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Regular
Expressions
101
Regular
Expressions
101
Upgrade to Pro
Enterprise
Community Library
Search community submissions...
x
URL
Open Workspace
PCRE (Legacy)
Match
Created 2015-06-03 17:33
1
Regular Expression
/
(
http
|
https
)
\:\/\/
(?:
(
.
+?
)(?:
\:
(
.
+?
)
)?
\@
)?(
(?:
[
\w
-
]
+
\.
)+
)(
[
A
-
Za
-
z0
-
9
]
+
)(?:
\:
(
\d
{2,5}
)
)?(
(?:
\/
[
\w
-%.
]
*
)+
)?(
\?
(?:
[
\w
-%&="'+,
]
+
)?
)?(
\#
(?:
[^
#
]
+
)?
)?
/
Description
Gets all parts of URL including port, username, password, fragment, query, and path
Submitted by
Vihan Bhargava