US Dollar Amount
beginnerMatches USD currency values like $1,234.56.
currencyusdmoneyvalidation
Pattern
/\$\d{1,3}(?:,\d{3})*(?:\.\d{2})?/gTry 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
| Language | Support |
|---|---|
| JS | Full support |
| PYTHON | Full support |
| JAVA | Full support |
| PHP | Full support |
| GO | Full 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);