HLRosenberger
asked on
Need regular expression to allow money.
How can I validate that a money amount has been entered?
ASKER
I don't need a negative, but I do want to used commas.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks.
Example if you want to validate $2000 you can use
^\$\d+$ or if you want to validate $3000.00 then use
^\$\d+\.\d{2}$ or if you want to validate a negative then use
^\-\$\d+$
or a parenthesis then add ^\(\$\d+\)$ .
Though there is a library for regular expressions which you can use it to tailor with your needs.
Hope this helps