Link to home
Start Free TrialLog in
Avatar of lynnwalker
lynnwalker

asked on

Pseudo currency regex validation

I need to validate positive currency values under $100, allowing the user to optionally leave out the decimal place. The dollar sign and comma are not needed (or allowed). Another validation component constrains the upper and lower values, so the regex expression only needs to validate 1 or 2 digits, with an optional decimal and 2 more digits.

These values would match:

10
5
5.00
10.00

These values would not match:

.25
10.1
10.255

What is the optimal regex pattern for this validation?
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial