IP Address Regex Pattern Tester
Test and validate regex patterns for IPv4 and IPv6 addresses. Copy ready-made IP address regex patterns with live testing. Free online regex tool for developers.
FAQ
Why is a simple \d+ pattern not enough for IPv4?
A pattern like \d+\.\d+\.\d+\.\d+ accepts numbers above 255 in each octet and allows leading zeros, matching invalid addresses like 999.1.1.1 or 01.02.03.04. A proper IPv4 regex must constrain each octet to the range 0-255 using alternation groups like (25[0-5]|2[0-4]\d|[01]?\d\d?).