Odd behaviour of regexp module

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


Hello

It seems the grouping feature isn't behaving correctly.

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

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

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

David




More information about the Python-list mailing list