Skip to content

Instantly share code, notes, and snippets.

@mgolub2
Created July 8, 2019 18:30
Show Gist options
  • Save mgolub2/38943aec982594a1cdfa0f2b0aec5f09 to your computer and use it in GitHub Desktop.
Save mgolub2/38943aec982594a1cdfa0f2b0aec5f09 to your computer and use it in GitHub Desktop.
Calculate Paypal Credit from Copy Paste
import re
import sys
calc = lambda x: sum([float(i.group(1).replace("$", "")) for i in re.finditer(r'(-*\$\d+\.\d+)', x)])
print(calc(sys.argv[1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment