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
Localhost/private ip origin check
Open Workspace
PCRE (Legacy)
Match
Created 2017-07-09 11:13
1
Regular Expression
/
^
(
https
?
:
\/\/
)?(
localhost
|
lvh
\.
me
|
::1
?
|
fe80::1
|
(
(
::f
{4}
:
)?(
1
(
0
|
27
)
\.
\d
{1,3}
|
172
\.
(
1
[
6
-
9
]
|
2
\d
|
3
[
01
]
)
|
192
\.
168
)
\.
\d
{1,3}
\.
\d
{1,3}
)
)(
:
\d
{1,5}
)?
/
g
Description
Used by CORS to check for localhost/private IP origins Check out the unit tests at
/r/2Ofume/1/tests
Submitted by
ngokimphu