I have a line of text as shown below and I want to extract the amount in it,
Your bill of USD 17.99 is due on 09-01-2002
And I have written the the regular expression like below, after considering the above line as String,
s = 'Your bill of USD 17.99 is due on 09-01-2002'
match = re.search( r'bill of.*([0-9]*\.[0-9]{2})', s.lower() )
if match:
print match.group(1)
It prints,
.99
But I want it to print 17.99
I just don't seem to understand why is not capturing the whole amount. I think it has to do something with greedy aspect of regular expressions. Any suggestion would be great help.
.*eats your17.