in reply to Re: Clarify this Regular Expression
in thread Clarify this Regular Expression

Mastering Regular Expressions has a discussion of a regex to match IP addresses, without matching anything that's not an IP. So Masem is correct in saying that this is a crude match.

However, I would point out that sometimes you can live with this. If you know that the file you're searching will never have something that looks like an IP address but isn't, then you can use a simpler regular expression. I have used m/^(10\.\d+\.\d+\.\d+)/ to pull IP addresses out of files, when I know that all the IP's on the LAN I'm concerned with start with 10, and none of the files I'm searching will have anything that could return a false match.

Chumley

Imagine a really clever .sig here.