Devtools.supstudio.in

Tools/Regex

IPv4

What this is

A naive \d{1,3} accepts 999.999.999.999. Tighten each octet to 25[0-5]|2[0-4]\d|1?\d?\d if you need validity. For storage, parse and range-check in code.

/\b(?:\d{1,3}\.){3}\d{1,3}\b/g
Gateway 192.168.0.1 and 10.0.0.2
999.1.1.1 looks like IPv4 but is not valid.

Open in tester

FAQ

CIDR?
This does not match 10.0.0.0/8. Add (?:/(3[0-2]|[12]?\d)) if you need prefixes.

Related