<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Looking for a regular expression</TITLE>
<META NAME="GENERATOR" CONTENT="StarOffice/5.2 (Linux)">
<META NAME="CREATED" CONTENT="20010723;20395700">
<META NAME="CHANGEDBY" CONTENT="Ben Beeson">
<META NAME="CHANGED" CONTENT="20010723;20443300">
</HEAD>
<BODY>
<P>To all,</P>
<P> 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:</P>
<P> $ grep "[0-9]\{2\}.[0-9]\{3\}.[0-9]\{2\}.[0-9]\{2\}"
/var/log/messages
</P>
<P>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?
</P>
<P>Thanks in advance,</P>
<P>Ben
</P>
<P><BR><BR>
</P>
<P>
</P>
<P><BR><BR>
</P>
<P><BR><BR>
</P>
</BODY>
</HTML>