Summary: posix regex for logtool

"Phil Wallisch" <[email protected]>
Newsgroups gmane.linux.admin.managers
Message-ID <[email protected]>
Thanks to:Steve SandauJeff WoodsBertrand Hutin When looking for a
specific IP i'm using "(xxx.xxx.xxx.xxx)" where x is a number i'm
interested in.  When looking for any IP i use Steve's method posted
below.  A man of regex doesn't reveal much to me but a man of egrep was
actually very helpful in constructing these expressions.  Thanks again. '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+'
This works on my Solaris box with egrep. Ought to work on Linux, too..
Steve Sandau
------------------------------------------------------------------------A
few rough approximations come to mind: rough: 
[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+
improved:       ([0-9]{1,3}\.){3}[0-9]{1,3}
better: ([0-2]{0,1}[0-9]{1,2}\.){3}[0-2]{0,1}[0-9]{1,2} Note:  Those are
all off the top of my head and completely untested so typos or other
errors may be present.  I recommend you read the regex(7) man page for
more info.  Also, if logtool uses "basic regular expressions" (instead of
the more powerful "extended regular expressions") then you may need to
insert additional backslash "\" escapes in front of each of these
characters: ( | ) { }
--
Jeff Woods <jdw-cq/[email protected]>
-----------------------------------------------------------------------------------
something like:
[1-2][0-9]*\.[1-2][0-9]*\.[1-2][0-9]*\.[1-2][0-9]*\
bertrand_hutin-xi/CRl/[email protected]

------------------------------------------------------------------------

Add photos to your e-mail with MSN 8. Get 2 months FREE*.
_______________________________________________
LinuxManagers mailing list - http://www.linuxmanagers.org
submissions: LinuxManagers-35TzE1X9F6582KRnZfj+bdi2O/[email protected]
subscribe/unsubscribe: http://www.linuxmanagers.org/mailman/listinfo/linuxmanagers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.