Looking for a regular expression

beesond001 at hawaii.rr.com beesond001 at hawaii.rr.com
Wed Jul 25 01:13:11 PDT 2001


To Ray and Jeff,

	Thanks, I'll try your ideas also.

Ben 

>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 7/23/01, 10:45:17 PM, Jeffrey Wong <jmwong at hoku.net> wrote regarding 
[luau] Re: Looking for a regular expression:


> What you have is pretty close to one way of doing it.  This would be a
> little better:

> egrep -e "[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}" 
/var/log/messages

> This should look for a sequence of 4 numbers consisting of between 1 and 
3
> digits each, separated by dots.  It won't filter out numbers larger than
> 255 but that shouldn't be a problem.  If you really want something that
> will do bounds checking I could probably whip up a little script, but 
that
> seems like alot of work for a minor thing and I'm feeling lazy right now
> ;)


> Jeff W.

> On Tue, 24 Jul 2001 beesond001 at hawaii.rr.com wrote:

> > To all,
> >     I'm looking for a regular expression that will fetch IP addresses 
from a
> > file such as /var/log/messages etc.  So far, I have a start, it looks
> > like this:
> >     $ grep "[0-9]\{2\}.[0-9]\{3\}.[0-9]\{2\}.[0-9]\{2\}" 
/var/log/messages
> > Unfortunately, it only works for certain types of IP addresses, those
> > with a form of  AA.BBB.CC.DD.  Is there a more general approach to
> > grabbing IP addresses, or will I have to write several forms of the above
> > regex and apply them all?
> > Thanks in advance,
> > Ben
> >
> >
> >
> >
> >
> > ---
> > You are currently subscribed to luau as: jmwong at hoku.net
> > To unsubscribe send a blank email to leave-luau-436Q at list.luau.hi.net
> >


> ---
> You are currently subscribed to luau as: beesond001 at hawaii.rr.com
> To unsubscribe send a blank email to $subst('Email.Unsub')
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freesoftwarehawaii.org/pipermail/luau-freesoftwarehawaii.org/attachments/20010725/70aeda67/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/rtf
Size: 6894 bytes
Desc: filename="text1.rtf"
URL: <http://lists.freesoftwarehawaii.org/pipermail/luau-freesoftwarehawaii.org/attachments/20010725/70aeda67/attachment-0001.rtf>


More information about the LUAU mailing list