[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: dig: single line



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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]