Regex To Match Dollar ($) And Comma (,) In String

A regular expression to match the dollar symbol and comma in a string.

Can be useful in removing unnecessary $ and , from a currency string. e.g., $12,345.12 -> 12345.12.

/[$,]/g

Matches:

  • $123,456.78
  • $123,456.78 $6,796

See Also:

Regex Is Copied!