expr = "name + partner_id.country_id.name + city + ' ' + 123 + '123' + 12*2/58%45"
print re.findall('\w+[.]',expr)
['name',
'partner_id',
'country_id',
'name',
'city',
'123',
'123',
'12',
'2',
'58',
'45']
I want to include "." so result should be like
['name',
'partner_id.country_id.name',
'city',
'123',
'123',
'12',
'2',
'58',
'45']