I need to validate a field that can be inputed as CURRENCY, or NUMERIC, or PERCENTAGE. I haven't seen any posts for ALL 3 conditions at once so wanted to ask the community.
I found the following code on here (thanks Gary!!) that works great for validating currency or numerics at the same time.
(?=.)^\$?(([1-9][0-9]{0,2}(,[0-9]{3})*)|[0-9]+)?(\.[0-9]{1,2})?$
How do you update this expresssion to validate for percentages as well?
Basically I would like to allow a percent symbol at the very end IF
- they don't enter a dollar sign
- (if possible I'd like to also validate that if they enter a percent symbol then the value can't be over 100, but I can live w/o this validation)