IPv4 Address

Validates IPv4 addresses

Live Tester— test the IPv4 Address pattern
Pattern/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/

Should match →

Should not match →

Pattern

^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$

Matching examples

192.168.1.110.0.0.1255.255.255.0

Non-matching examples

256.1.1.11.2.3abc.def.ghi.jkl

Breakdown

^(?:...)\.{3}(?:...)$
Four octets (0-255) separated by dots
25[0-5]|2[0-4]\d|[01]?\d\d?
Single octet: 0-255

Related tools

Other patterns