This line:
[m.groupdict() for m in rure.compile('(?P<word>\w+)').finditer("hello there")]
Returns this:
[{'word': 'h'}, {'word': 't'}]
I would expect it to return this:
[{'word': 'hello'}, {'word': 'there'}]
Adding a second named group fixes this issue for some reason:
[m.groupdict() for m in rure.compile('(?P<name>\w+)(?P<nomatch>)').finditer("hello there")]
Returns:
[{'name': 'hello', 'nomatch': ''}, {'name': 'there', 'nomatch': ''}]