i
Hate
Regex
Library
Cheatsheet
Community
Open playground
match an ipv4 address
Regex title
Edit anything to remix
Remix in playground
JavaScript
Expression
/
Regular expression
(
\b
25
[0-5]
|
\b
2
[0-4]
[0-9]
|
\b
[01]
?
[0-9]
[0-9]
?
)
(
\.
(
25
[0-5]
|
2
[0-4]
[0-9]
|
[01]
?
[0-9]
[0-9]
?
)
)
{3}
(\b25[0-5]|\b2[0-4][0-9]|\b[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}
/
gm
g
i
m
s
u
y
flags
Test bench
Sample text
5 matches
192.168.1.1
127.0.0.1
0.0.0.0
255.255.255.255
256.256.256.256 999.999.999.999 1.2.3
1.2.3.4
192.168.1.1 127.0.0.1 0.0.0.0 255.255.255.255 256.256.256.256 999.999.999.999 1.2.3 1.2.3.4
Structure
Railroad diagram
Interactive
SVG
PNG
Copy
Embed
Live
Strings that match
192.168.1.1
127.0.0.1
0.0.0.0
255.255.255.255
1.2.3.4
Strings that don’t match
256.256.256.256
999.999.999.999
1.2.3
Related patterns
ip address(ipv6)
match an ipv6 address
port number
matches a port number in computer networks