fork download
  1. import re
  2. test = 'We four guys, live at 2nd street of Malibeu. I had a cash of $248 in my pocket. I got a ticket with serial number ABC1234.'
  3.  
  4. arr = re.findall(r'(?:\$|\b[A-Z]+)?\d+', test)
  5. print(arr)
Success #stdin #stdout 0.02s 9540KB
stdin
Standard input is empty
stdout
['2', '$248', 'ABC1234']