URL:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=16567>
Summary: -i and character classes `[ab]' in multibyte locale
(utf8)
Project: grep
Submitted by: None
Submitted on: Freitag 12.05.2006 um 05:59 UTC
Category: None
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
_______________________________________________________
Details:
`[ab]' and `(a|b)' in combination with option `-i' should be equivalent, I
guess. They aren't in multibyte locales (utf8).
In addition `-i' prohibits a match when `[AaBb]' is searched.
The error doesn't occur when the text is downcase and the pattern uppercase.
[volga:~] echo Elk | LC_ALL=C grep -i '[eo]lk'
Elk
[volga:~] echo Elk | LC_ALL=en_US grep -i '[eo]lk'
Elk
[volga:~] echo Elk | LC_ALL=en_US.utf8 grep -i '[eo]lk'
[volga:~] echo Elk | LC_ALL=en_US.utf8 grep -i '\(e\|o\)lk'
Elk
[volga:~] echo Elk | LC_ALL=en_US.utf8 grep -i '[EeOo]lk'
[volga:~] echo Elk | LC_ALL=en_US.utf8 grep '[EeOo]lk'
Elk
[volga:~] echo elk | LC_ALL=en_US.utf8 grep -i '[EO]lk'
elk
[volga:~] grep -V
grep (GNU grep) 2.5.1
[volga:~] uname -a
Linux volga 2.6.13-15.8-default #1 Tue Feb 7 11:07:24 UTC 2006 i686 i686 i386
GNU/Linux
In the manpage I found:
Many locales sort characters in dictionary order, and in these
locales
[a-d] is typically not equivalent to [abcd]; it might be equivalent to
[aBbCcDd], for example.
sebastian nagel (wastl[]cis.uni-muenchen.de)
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=16567>
_______________________________________________
Nachricht geschickt von/durch Savannah
http://savannah.gnu.org/