tags:

views:

42

answers:

1

I'm using WinGrep to search for IP Addresses in a .txt file, but i can't figure out how to get it to use a regular expression to search. does anyone have any experience with this?

+1  A: 

If you don't need to consider IPv6, only want numeric IP addresses without port numbers, and don't need to validate the addresses (i. e., not matching illegal addresses line 321.456.299.999) then you can use

\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b

If you need to do any of the above things, please update your question.

Tim Pietzcker
The + is not needed after \d as you specify {1,3}
M42
Erm, yes. No idea how they got there :)
Tim Pietzcker