rNumbersAndAmounts constant

String const rNumbersAndAmounts

Matches all numbers and amounts, including:

  • numbers delimited with periods and or commas;
  • single non-word currency symbol ($€£¥₣₹ك]) prefixes;
  • any three-letter upper-case pre-fixes e.g. "USD" or "GBP"
  • a single "%" suffix; and
  • three-letter currency identifiers in any combination of upper-case letters.

Implementation

static const rNumbersAndAmounts = r'(?<=^|\s)([$€£¥₣₹ك]{1}|[A-Z]{3})?(\d+|'
    r'((?<=\d)[,.]{1}(?=\d)))+([%]{1})?(?=$|\W)';