Skip to main content
CalcHive

Regex for Currency Amount (USD)

Matches US dollar amounts with optional $ sign, thousand separators, and cents. Examples: $1,234.56, 99.99, $1000.

Pattern

/^\$?\d{1,3}(,\d{3})*(\.\d{2})?$/

Pattern Breakdown

TokenExplanation
^Start of string
\$?Optional dollar sign
\d{1,3}1-3 initial digits
(,\d{3})*Optional comma-separated thousands
(\.\d{2})?Optional cents (dot and 2 digits)
$End of string

Test Examples

InputMatch?
$1,234.56Match
99.99Match
$1000Match
$1,23.45No match
1.2No match

Common Use Cases

  • Price input validation
  • Invoice parsing
  • Financial data extraction

Variations

^\$?[\d,]+(\.\d{2})?$

Simpler with less strict formatting

Want to test this pattern with your own data?

Open the Regex Tester