[Python-bugs-list] [ python-Bugs-646707 ] {n} gets confused when teamed with (|)

noreply@sourceforge.net noreply@sourceforge.net
Sun, 01 Dec 2002 15:03:54 -0800


Bugs item #646707, was opened at 2002-12-01 18:03
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=646707&group_id=5470

Category: Regular Expressions
Group: Python 2.2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Rolf Campbell (endlisnis)
Assigned to: Fredrik Lundh (effbot)
Summary: {n} gets confused when teamed with (|)

Initial Comment:
Python 2.2.2 (#1, Nov 15 2002, 07:49:04) 
[GCC 2.95.3-5 (cygwin special)] on cygwin
Type "help", "copyright", "credits" or "license" for
more information.
>>> import re
>>> re.findall("(a|b|c|d){2}", "abcd")
['b', 'd']

expected ['ab', 'cd']

If I try that with grep:
$ echo abcd | egrep -o '(a|b|c|d){2}'
ab
cd


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=646707&group_id=5470