[geeks] Regular Expressions

Mailing Lists Address mattyml at daemons.net
Thu Aug 8 15:14:19 CDT 2002


I topyed with it some more, and ended up using:

egrep '[2][2-3][0-9]\.[0-9].*\.[0-9].*\.[0-9].*'

to fix my debacle. On further examiniation of the egrep man page, I saw

"The /usr/bin/egrep utility accepts full regular  expressions
 as described on the regexp(5) manual page, except for \( and
 \), \( and \), \{ and \}, \< and \>, and \n,  and  with  the
 addition of:"

I read it kinda fast the first time, and missed the "except". The
regexp above fixed my issue. I also needed to update the third range
operator.

- Ryan

On Thu, 8 Aug 2002, Caleb Shay wrote:

> Ryan wrote:
>
> >Howdy,
> >
> >Does anyone happen to know why the following block
> >of code refuses to find multicast addresses?
> >
> >netstat -rn | egrep \
> >'([2][2-3][4-9])\.([0-9]{3})\.([0-9]{3})\.([0-9]{3})'
> >
> well, that wouldn't match something like 231.
>
> >
> >The multicast range is 224.0.0.0 to 239.255.255.255. I can also see
> >multicast addresses in the netstat -rn output.
> >
> >I look forward to any thoughts or suggestions,
> >Ryan
> >_______________________________________________
> >GEEKS:  http://www.sunhelp.org/mailman/listinfo/geeks
> _______________________________________________
> GEEKS:  http://www.sunhelp.org/mailman/listinfo/geeks



More information about the geeks mailing list