fork download
  1. import re
  2.  
  3. s = 'Your bill of USD 17.99 is due on 09-01-2002'
  4.  
  5. match = re.search( r"bill.*?([\d]+\.[\d]{2})", s.lower() )
  6. if match:
  7. print match.group(1)
Success #stdin #stdout 0.01s 7736KB
stdin
Standard input is empty
stdout
17.99