RegexHub
RegexHub copied to clipboard
Regex for dollar or currency amounts
I find I frequently need a regex for dollar amounts, for example: \d*(\.\d{1,4})?
Would this be something that would make sense to add?
If it's a dollar amount, wouldn't it make more sense to have 2 decimal places, instead of 1 to 4?
Some currencies may have more than 2 decimal places, thus my example, but in most cases, sure, maybe 2 decimal places is more common.
Good point. By "dollar" I thought you meant USD. :)