[New-bugs-announce] [issue16990] re: match of nongreedy regex not grouping right

Jared Grubb report at bugs.python.org
Fri Jan 18 00:49:03 CET 2013


New submission from Jared Grubb:

re.match matches, but the capture groups are empty. That's not possible.

Python 2.7.2 (default, Oct 11 2012, 20:14:37) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> re.match('.*', 'stuff').group()  # greedy matches and captures; cool.
'stuff'
>>> re.match('.*?', 'stuff').group() # nongreedy matches (cool) but doesnt capture (huh?)
''

----------
components: Library (Lib)
messages: 180162
nosy: jaredgrubb
priority: normal
severity: normal
status: open
title: re: match of nongreedy regex not grouping right
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16990>
_______________________________________


More information about the New-bugs-announce mailing list