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

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

grep: matching '\([A]\|[B]\)\{2\}' in different locales


From: Harald van Dijk
Subject: grep: matching '\([A]\|[B]\)\{2\}' in different locales
Date: Sat, 16 Jul 2005 02:31:58 +0200

Hi,

When I try to grep '\([A]\|[B]\)\{2\}', and as input I pass AA / AB / BA / BB (yes, on separate lines), in the C locale, grep prints all four lines. However, in UTF-8 locales (specifically en_GB.UTF-8, but I got the same result with some others as well), it only prints the second and fourth line. If I change [B] to B, or [A] to A, or both, grep prints all four lines regardless of locale. If I remove \{2\} and try '\([A]\|[B]\)\([A]\|[B]\)' instead, grep again prints all four lines regardless of locale.

I've tested this with grep 2.5.1 on Linux, configured with nothing more than --prefix=$HOME/grep, compiled with gcc 4.0.1, on a system with glibc 2.3.5 (20050421 snapshot). I also tried --with-included-regex just in case, but this didn't change anything.

Am I correct in assuming this is a bug?






reply via email to

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