buggrep - Bugs: bug #13859, matching '\([A]\|[B]\)\{2\}' in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

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

Submitter:  None
Submitted:  Wed 20 Jul 2005 12:52:49 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Wed 17 Mar 2010 08:26:12 AM UTC, comment #5: 

Thank you for the bug report. This bug has been fixed in the
development sources, which can be downloaded using git from
git://git.sv.gnu.org/grep.git

Paolo Bonzini <bonzini>
Fri 04 Dec 2009 08:07:31 PM UTC, comment #4: 

Broken in git and FC12.

Paolo Bonzini <bonzini>
Wed 20 Jul 2005 05:33:41 PM UTC, comment #3: 

Oops, I see URLs containing anything resembling e-mail addresses are to be avoided here. Sorry for the mangled comment... I'll go report it, if it hasn't been yet.

Anonymous
Wed 20 Jul 2005 05:28:39 PM UTC, comment #2: 

Thank you, that version works correctly regardless of locale for me too. The problem seems to be worked around by your dfa_optional patch. If I keep all other patches, but unapply that, it starts failing for me again. After reading http://www.mail-archive.com/bug-grep@gnu.org/msg00068.html I think this is simple luck on your part, since it doesn't appear to be intended to do anything but speed things up :-)

Anonymous
Wed 20 Jul 2005 03:06:27 PM UTC, comment #1: 

FWIW, this works fine on Fedora Core 4 with grep-2.5.1-48.2.

$ (for a in AA AB BA BB; do echo $a ; done )| grep '\([A]\|[B]\)\{2\}'
AA
AB
BA
BB

Tim Waugh <twaugh>
Wed 20 Jul 2005 12:52:49 PM UTC, original submission:  

Hi,

Firstly, I had originally e-mailed this to bug-gnu-utils@gnu.org, as described in the info page for grep, but since I didn't get any response, and I then found the link here on gnu.org/software/grep/, I thought it'd be best to report this again. My apologies if I should've just waited longer.

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?

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bonzini (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-03-17 bonzini StatusNone Fixed
        Open/ClosedOpen Closed
        Summarymatching \'\\([A]\\|[B]\\)\\{2\\}\' in different locales matching '\([A]\|[B]\)\{2\}' in different locales
    2009-12-04 bonzini Summarymatching \'\\([A]\\|[B]\\)\\{2\\}\' in different locales matching '\([A]\|[B]\)\{2\}' in different locales

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code