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
url and path match with or without http|https
Open Workspace
PCRE (Legacy)
Match
Created 2015-07-24 01:29
0
Regular Expression
/
^
(
https
?
:
\/\/
)?(
[
\d
a
-
z-
]
+
\.
)+(
[
a
-
z
]
{2,6}
)?(
\/
(
[
a
-
z0
-
9+
\$
_-
]
\.
?
)+
)*
\/
?
$
/
Description
this is the most perfect pattern I reach for url with query or anchor
Submitted by
Gehad Mohamed