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
Validates an IPv4 Address
Open Workspace
PCRE2 (PHP)
Match
Updated 2024-08-26 13:21
0
Regular Expression
/
^
(?:
(
[
1
-
9
]
?
[
0
-
9
]
|
1
[
0
-
9
]
{2}
|
2
[
0
-
4
]
[
0
-
9
]
|
25
[
0
-
5
]
)
\.
){3}
(?1)
$
/
gm
Description
Given a string, the regex would match if it is a valid IPv4 address.
Submitted by
A-Paint-Brush