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
Regex to match URLs in a string
Open Workspace
JavaScript
Match
Created 2025-05-15 02:38
1
Regular Expression
/
(
http
|
https
)
\:\/\/
[
a
-
zA
-
Z0
-
9.-
]
+
(
\.
[
a
-
zA
-
Z
]
+
)+(
\/
.
*
)?
/
gm
Description
Regex to match URLs in a string with http and https protocol and optional paths in URL
Submitted by
Kaustubh