dig: single line

Matthew Flaschen matthew.flaschen at gatech.edu
Thu Mar 12 03:17:16 UTC 2009


Mike -- EMAIL IGNORED wrote:
> How about:
> 
>    grep "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]"
> 
> ?
> Can it be done more concisely?  Still, one of
> the numbers might exceed 255 ... unlikely.

Just keep it simple ;), and use
(http://www.regular-expressions.info/examples.html):

perl -e "print
grep(/\b(?:(?: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]?)\b/,<>);"

All one line, of course.

Matt Flaschen




More information about the fedora-list mailing list