Issue 1555496: Bug in the match function (original) (raw)
Issue1555496
Created on 2006-09-09 20:02 by wojtekwu, last changed 2022-04-11 14:56 by admin. This issue is now closed.
Messages (3) | ||
---|---|---|
msg29790 - (view) | Author: wojtekwu (wojtekwu) | Date: 2006-09-09 20:02 |
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)*) |
msg29791 - (view) | Author: Georg Brandl (georg.brandl) * ![]() |
Date: 2006-09-09 20:06 |
Logged In: YES user_id=849994 IMHO that's not a bug, since we have a "leftmost alternative" strategy, not a "longest match". | ||
msg29792 - (view) | Author: Tim Peters (tim.peters) * ![]() |
Date: 2006-09-09 22:23 |
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. |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:56:20 | admin | set | github: 43957 |
2006-09-09 20:02:38 | wojtekwu | create |