Skip to main content
Regexflux

US Dollar Amount

beginner

Matches USD currency values like $1,234.56.

currencyusdmoneyvalidation

Pattern

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

Try It

0 of 7 strings matched

Explanation

Matches dollar sign, integer part with optional comma-separated thousands, and optional cents (exactly 2 decimal places).

Test Strings

Matching

  • $1,234.56
  • $0.99
  • $1,000,000
  • $42

Non-matching

  • 1234.56
  • €100
  • free

Language Compatibility

LanguageSupport
JSFull support
PYTHONFull support
JAVAFull support
PHPFull support
GOFull support

Code Snippets

const regex = /\$\d{1,3}(?:,\d{3})*(?:\.\d{2})?/g;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);

Related Patterns