bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grep 2.4.2 incorrect handling of '[x^]'


From: Alain Magloire
Subject: Re: grep 2.4.2 incorrect handling of '[x^]'
Date: Sun, 29 Jul 2001 11:41:42 -0400 (EDT)

Bonjour

> # echo 123 | grep '[x^]'
> 123
> # grep --version
> grep (GNU grep) 2.4.2
> 
> Incorrect handling of bracketed expressions containing '^' other than
> as the first character.  grep calls regcomp for each character [x-x],
> [^-^], the last ends up matching the first character in all input.

# uname -rs
Linux 2.2.5-15
# grep --version
grep (GNU grep) 2.4.2

Copyright 1988, 1992-1999, 2000 Free Software Foundation, Inc.
...
# /bin/echo 123 | /usr/local/src/grep/grep-2.4.2/src/grep  '[x^]'
#
#/bin/echo 12^3 | /usr/local/src/grep/grep-2.4.2/src/grep  '[x^]'
12^3
#


GNU grep only call, or fallback to GNU regex(part of libc) when it
can not compile the regex(for example regexes with backreference \1\2..)
is not supported, in the dfa.

I've seen a lot of bug reports concerning the use of bracket expression
and was unable to reproduce any.  However most where locale dependent
stuff (set LANG=C), range expressions(ex: [A-z]) are locale dependent.

-- 
au revoir, alain
----
Aussi haut que l'on soit assis, on est toujours assis que sur son cul !!!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]