Regular Exp

afds adf at hotmail.com
Fri Oct 31 03:11:39 EST 2003


If I want to match $.58 in $.589922 How do I do it with Regular Expressions?

>>> s=re.search("\$\.[0-9]{2}", "$.589922")
>>> s.string
'$.589922'
and not
'$.58' which i s what I want
I think it has something to do with Greediness right?






More information about the Python-list mailing list