2 ms·
Even in an IPv4-only world, that regexp admits strings like 123.456.7890.12345.
by yuubi 11y ago
Even in an IPv4-only world, that regexp admits strings like 123.456.7890.12345.
- CountSessine 11y agoYou're capturing the octets individually. You already have to do bounds checking on RFC 1918 ranges and such. Why wouldn't you do the octet checking in your post-match logic? This is just pedantic.
- istvan__ 11y agoHow about? ^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$