Looking for a regular expression

beesond001 at hawaii.rr.com beesond001 at hawaii.rr.com
Mon Jul 23 23:44:33 PDT 2001


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 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freesoftwarehawaii.org/pipermail/luau-freesoftwarehawaii.org/attachments/20010724/5fa5d54f/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/rtf
Size: 4664 bytes
Desc: filename="text1.rtf"
URL: <http://lists.freesoftwarehawaii.org/pipermail/luau-freesoftwarehawaii.org/attachments/20010724/5fa5d54f/attachment-0001.rtf>


More information about the LUAU mailing list