Author: cubangt | Posted on: 11/10/2009 12:53:21 PM | Views : 306

i have a field that i doing some dividing and such in the code behind based on the entered value. So i need to make sure that the RegEx Validator doesnt allow anything but NUMBERS and COMMAS and DECIMALS
I found 2 that come close, but dont prevent the $ from causing it to fail.
#1 = ^[+]?\d*$  == Numbers only... no symbols  this one works, but doesnt allow any symbols.. so if someone wanted to enter 10.05 it would fail.. for my app that would be a valid value so i need to accept that.
#2 =  ^(((\d{1,3})(,\d{3})*)|(\d+))(.\d+)?$    ==  validates numbers, with or without decimal places, and comma 1000 separators. This one works but still allows $ which then causes the page to pass validation but fail when the code behind tries to do the dividing. i get this error  ERROR= Input string was not in a correct format.
So i need a regex that allows numbers, commas, and decimal points.< ...

Go to the complete details ...