What is a regex that can find a routable IPv4 addresses only? EG, does not match 192.0.2.1/24, 127.0.0.1, etc. Google seems to only find the all too common 'is an ip address' regex.
+2
A:
Trying to implement business rules in a regex is a bad idea.
Just parse the IP address, and check whether it satisfies your criteria in code.
Anon.
2010-02-17 22:07:34
A:
You can't do this in a regex anyway, not efficiently. Parse it, then check against the special-case addresses (multicast, RFC 1918, etc).
Andrew McGregor
2010-02-17 23:29:56