Wednesday, October 17, 2007

Regular Expression for IP-Format

Here is the Regular Expression for the IP-Format. I used it for grepping different IPs from Apaches access.log

[0-9]*[0-9]*[0-9][.][0-9]*[0-9]*[0-9][.][0-9]*[0-9]*[0-9][.][0-9]*[0-9]*[0-9]

The only limitation is, that it's not delimited to 255.255.255.255 --> IP 999.999.999.999 will also be found :-)

No comments: