<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Re: [luau] Re: Looking for a regular expression</TITLE>
<META NAME="GENERATOR" CONTENT="StarOffice/5.2 (Linux)">
<META NAME="CREATED" CONTENT="20010724;22122300">
<META NAME="CHANGEDBY" CONTENT="Ben Beeson">
<META NAME="CHANGED" CONTENT="20010724;22131100">
</HEAD>
<BODY>
<PRE>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@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@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@hoku.net
> > To unsubscribe send a blank email to
$subst('Email.Unsub')
> >
> ---
> You are currently subscribed to luau as: beesond001@hawaii.rr.com
> To unsubscribe send a blank email to leave-luau-436Q@list.luau.hi.net</PRE>
</BODY>
</HTML>