Can I specify regex group to return float or int instead of string?

Jeremy jlconlin at gmail.com
Thu Feb 25 10:48:44 EST 2010


I have a regular expression that searches for some numbers and puts
them into a dictionary, i.e.

'(?P<integer>\d+)\s+(?P<float>\d+\.\d+)'

Is it possible to have the results of the matches returned as int or
float objects instead of strings?

Thanks,
Jeremy



More information about the Python-list mailing list