This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug regex/14301] Regular expression wrong match with a number of groups


http://sourceware.org/bugzilla/show_bug.cgi?id=14301

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
                 CC|                            |fweimer at redhat dot com
         Resolution|                            |INVALID

--- Comment #3 from Florian Weimer <fweimer at redhat dot com> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]