/
(?(DEFINE)
(?<currency_symbol> \p{Sc} )
(?<leading_group> [1-9] \d{0,2}+ )
(?<group> \d{3} )
(?<non_leading_groups> (?&group) (?:(?&group_delim)(?&group))*+ )
(?<decimal_delim>
(?# Use the opposite of group_delim. )
(?(group_delim_comma)
\.
| (?(group_delim_period)
,
| [,.] (?# There's no definitive grouping_delim. )
)
)
)
)
^
(?>
(?¤cy_symbol)
(?&leading_group)
(?:
(?<group_delim>
(?<group_delim_comma> , ) |
(?<group_delim_period> \. ) |
\ (?# Allow whitespace as a delimiter. )