Subject: Re: Problem with regular expression using grep -E

Upon closer investigation of the string I am searching for, I believe I have
found the error, but am unsure on how to correct this issue. In the third
regex sting, I am searching for through 63. In my example, retrieves log lines with reference to, so .23 &
.230 & .231 & .232 etc...

Is there a way to match the exact expression, nothing more so return but NOT where x = 0 through 9. The same would
need to apply to expressions .24 and .25 and for that matter .11 but not
.110 or .111 etc...

Is this possible?

On 7/5/07, Joey Officer <jofficer@xxxxxxxxx> wrote:

I think I have found a bug in grep's usage of regular expressions, or
possibly an error in my regular expression although I have checked and
rechecked my expression.

I process the following command:

zcat -c logfile.gz | grep -E -f searchIP.txt >> filteredIPs.log


the above regular expression should return all IP ranges for (line1) through (line2) and through through (line3).

When I review the results of filteredIPs.log I see IP address that fall
outside of those ranges. For example, I see listed in the
result sets, which should be excluded.

The following may or may not be useful information:

$ uname -a
CYGWIN_NT-5.2 bkfnocbcr1 1.5.24(0.156/4/2) 2007-01-31 10:57 i686 Cygwin

$ grep --version
grep (GNU grep) 2.5.1

Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PART...


$ zcat --version
gzip 1.3.12
Copyright (C) 2007 Free Software Foundation, Inc.
Copyright (C) 1993 Jean-loup Gailly.
This is free software. You may redistribute copies of it under the terms
the GNU General Public License < >.
There is NO WARRANTY, to the extent permitted by law.

Written by Jean-loup Gailly.