Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
r"
^(http[s]?:\/\/)?([^:\/\s]+)(:([^\/]*))?(\/\w+\.)*([^#?\s]+)(\?([^#]*))?(#(.*))?$
"
i
Input 1
HTtpS://regexr.com/more/less/path/foo.html?q=bar&same=xxx#sldns13123nfdwdw
Substitution
HTtpS://regexr.com/more/less/path/foo.html?q=bar&same=xxx#sldns13123nfdwdw