Regular expression for validating numbers
The Validation Expression attribute has a button next to it, and if you click it, you will gain access to some default expressions, delivered by the ASP.
You need TWO validator controls to ensure only numeric values are entered.
Are you trying to craft a regular expression for an input to validate it is a numeric value?
Decimals are numerics so you don't need to check for decimals specifically. To allow numbers with an optional decimal point followed by digits.
A digit in the range 1-9 followed by zero or more other digits then optionally followed by a decimal point followed by at least 1 digit: i.e.
Try switching to Design view and select the Regular Expression Validator on your page.
Now have a look in the Properties tab of Visual Studio.
It's make the regex to be 4 chars longer, but fix the problem for you also.If you don't feel like learning Regular Expressions, but still feel like using this validator, have a look around the Internet.You can find many pre-made expressions out there, which can be very useful to you.Hi Team, How to validate the "number field" for example: In my form i have Enter No.of Items Text box, in that user should enter only numeric values only not any characters or text or special characters.