fork download
  1. import re
  2. currencies = ['$', '£', '€']
  3. key_characters = ''.join(currencies)
  4. price_re = re.compile(r'[{}]\s?\d{{1,3}}(?:[.,]\d{{3}})*(?:[.,]\d{{1,2}})?'.format(key_characters))
  5. for m in price_re.findall(r'$13344,34, £3424, €7777'):
  6. print(m)
Success #stdin #stdout 0.04s 10092KB
stdin
Standard input is empty
stdout
$133
£342
€777