Pseudo currency regex validation
Posted on 2014-12-30
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:
These values would not match:
What is the optimal regex pattern for this validation?