Thursday 7 August 2008

Validating Currency fields regular expression

Expression: ^\d{0,2}($|\.\d{0,2}$)
Example of valid values:
20.09
1.99
1.2
3
.5

Example of invalid values:
120.09
1.991
x

No comments: