Skip to content
  • No data uploaded
  • Instant results

Regex for IPv4 Address

Pattern: /\b(?:(?:25[0-5]|2[0-4]\d|1?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|1?\d?\d)\b/g. Test it below and adapt it to your data — validation regexes are always a trade-off between strictness and real-world inputs.

Regex for IPv4 Address

Matches2/\b(?:(?:25[0-5]|2[0-4]\d|1?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|1?\d?\d)\b/g
Hosts 192.168.1.10, 10.0.0.255 and invalid 999.1.1.1
Match details
#MatchIndexGroups
1192.168.1.106—
210.0.0.25520—

JavaScript (ECMAScript) regular expressions. Without the g flag only the first match is used by String.match — this tester always lists all matches.

Free Regex for IPv4 Address by pGento

Frequently asked questions

Is my data uploaded?
No. The calculation runs entirely in your browser — nothing you type is sent to a server.
Is it free?
Yes — free, unlimited and no sign-up.
Regex for IPv4 Address

Embed this tool on your site

Paste this code into any web page. It stays free, fast and ad-free inside your site.

Print or save as PDF

Prints just this tool and its result. Choose “Save as PDF” as the printer to get a file. Branding is stored only in this browser.