fork(1) download
  1. import re
  2.  
  3. email = """
  4. 2) From: Claire Fitz-Gerald
  5. Date: 9/5/2014 9:52 AM
  6. Subject: NEFS 5 Available Fish
  7.  
  8. All,
  9. NEFS 5 has the following fish available for lease/trade:
  10.  
  11. GB EAST cod: 954 lbs @ $0.83
  12. GB EAST cod: 1,046 lbs to trade for 1,830 lbs GB WEST cod
  13. GB blackback: 30,000 lbs @ $0.07
  14. GOM blackback: 800 lbs @ $0.03
  15. white hake: 6,322 lbs @ $0.13
  16. pollock: 22,000 lbs @ $0.015
  17. redfish: 14,000 lbs @ $0.015
  18. GB yt: 1,873 lbs @ $1.13
  19. GB yt: 5,127 lbs to trade for 10,254 lbs SNE yt
  20. """
  21.  
  22. rx = re.compile(r'(\d[\d,]{3,}) lbs')
  23. weights = rx.findall(email)
  24. print(weights)
Success #stdin #stdout 0.02s 9992KB
stdin
Standard input is empty
stdout
['1,046', '1,830', '30,000', '6,322', '22,000', '14,000', '1,873', '5,127', '10,254']