Odd behaviour of regexp module

David Veerasingam vdavidster at gmail.com
Wed Jul 13 23:05:37 CEST 2005


It seems the grouping feature isn't behaving correctly.

In [1]: a = 'dfsf.oct.ocfe'

In [2]: b = re.match(r'^(.*?)\.', a); b.group()

The expected result is 'dfsf'. Why did the regexp grab that period at
the end?


More information about the Python-list mailing list