regular expression for integer and decimal numbers

Peter Hansen peter at engcorp.com
Fri Sep 24 07:00:09 EDT 2004


gary wrote:
> I want to pick all intergers and decimal numbers out of a string.
> Would this be the most correct regular expression to use?
> 
> "\d+\.?\d*"

Examples, including the most extreme cases you want to handle,
are always a good idea.

-Peter



More information about the Python-list mailing list