Bugs item #1555496, was opened at 2006-09-09 16:02 Message generated for change (Comment added) made by tim_one You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1555496&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Regular Expressions >Group: Not a Bug >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: wojtekwu (wojtekwu) Assigned to: Gustavo Niemeyer (niemeyer) Summary: Bug in the match function Initial Comment: Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import re >>> as = re.compile("(a|((a|b)*))") >>> wynik = as.match("aabaa") >>> wynik.end() 1 >>> as = re.compile("(((a|b)*)|a)") >>> wynik = as.match("aabaa") >>> wynik.end() 5 >>> ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2006-09-09 18:23 Message: Logged In: YES user_id=31435 That's right -- the first ("leftmost") alternative that matches wins; same as Perl, etc etc. Closing as Not-A-Bug. ---------------------------------------------------------------------- Comment By: Georg Brandl (gbrandl) Date: 2006-09-09 16:06 Message: Logged In: YES user_id=849994 IMHO that's not a bug, since we have a "leftmost alternative" strategy, not a "longest match". ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1555496&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com