[issue28486] Wrong end index and subgroup for group match

2016-10-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: group(0) returns the whole match. group(1) returns the first captured subgroup. -- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue28486] Wrong end index and subgroup for group match

2016-10-20 Thread Pavel Cisar
Changes by Pavel Cisar : -- versions: +Python 3.5 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue28486] Wrong end index and subgroup for group match

2016-10-20 Thread Pavel Cisar
New submission from Pavel Cisar: Hi, python re returns wrong end index of searched group and also subgroup itself. Example: In: price_string = u"1 307 000,00 Kč" In: match = re.search(r"([,\.]00)\s?.*$", price_string) In: print price_string, "|", match.groups(), "|", match.group(0), "|", match