fork download
  1. import re
  2. rx = r"\$(\d[\d,.]*)[\n\r]+(?:.*[\r\n]+){0,2}Issued\s+on\b"
  3. s = "Delivery Charge $2\nPromo - (FIRST) ($4)\n$1,000.55\nNew Coins earned $5\nIssued on behalf of ......................."
  4. match = re.search(rx, s, re.M)
  5. if match:
  6. print(match.group(1))
Success #stdin #stdout 0.01s 27712KB
stdin
Standard input is empty
stdout
1,000.55