Regex for Matching a Currency Amount

Matches a dollar amount with optional thousands separators and cents.

Published October 12, 2026

Matches a dollar amount with optional thousands separators and cents.

Key points

  • Matches formats like $1,234.56, 1234.56, and $99
  • Currency formatting varies significantly by locale — this pattern assumes US-style formatting

Example

^\$?\d{1,3}(,\d{3})*(\.\d{2})?$
More General articles