Skip to content

Instantly share code, notes, and snippets.

@modsognir
Last active August 29, 2015 13:59
Show Gist options
  • Save modsognir/10741036 to your computer and use it in GitHub Desktop.
Save modsognir/10741036 to your computer and use it in GitHub Desktop.
Regex the crap out of currency
http://www.evertype.com/standards/euro/formats.html
^(?<front_currency>[ €$£]{,2})(?<integer>[0-9,. ]*?)(?:([,.])(?<fractional>[0-9]{,2}))?(?<tail_currency>[ €$£]{,2})$
1,000
1,000.00
1,000,000.00
1 000.00 €
1.000
1a000
€1.000,00
1.234,56 €
€1.234,56
1 234,56 €
€1.234,56
€1,234.56
€ 1.234,56
$120
120$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment