I am trying to validate a textbox with a regular expression…
regex expression=(\d{0,4})?([\.]{1})?(\d{0,2})
I am having a problem with the decimal point. the decimal point is optional. the regex should validate for only one decimal point.
example 1.00 ,23.22 , .65 is valid
1.. or 23.. is invalid.
Any suggestions for improving my regex??
Try this one :
^\d{1,4}(\.\d{1,2})?$It should match :
But not :
Edit :
If you want to match 65. or 9999. use this one instead (see comments) :