From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25963 invoked by alias); 27 Jun 2012 08:33:19 -0000 Received: (qmail 25950 invoked by uid 22791); 27 Jun 2012 08:33:18 -0000 X-SWARE-Spam-Status: No, hits=-3.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 27 Jun 2012 08:33:07 +0000 From: "fweimer at redhat dot com" To: glibc-bugs-regex@sources.redhat.com Subject: [Bug regex/14301] Regular expression wrong match with a number of groups Date: Wed, 27 Jun 2012 08:33:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: regex X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fweimer at redhat dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status CC Resolution Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact glibc-bugs-regex-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-regex-owner@sourceware.org X-SW-Source: 2012-06/txt/msg00003.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=14301 Florian Weimer changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED CC| |fweimer at redhat dot com Resolution| |INVALID --- Comment #3 from Florian Weimer 2012-06-27 08:32:43 UTC --- (In reply to comment #2) > (In reply to comment #1) > > (4[0-9]{12}) matches 4123456789012. > > So what? > Regular expression required leading and trailing space to be present for match. I don't think so. "|" does not bind this way. a[b]|c|d[e] is equivalent to (ab)|c|(de), not (a)(b|c|d)(e). > Also please note, that in case 3 and 4 regular expressions are essentially the > same - only (4[0-9]{15}) and (4[0-9]{12}) that connected with OR swapped. This also explains the difference when swapping the parenthesized constructs. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.