Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# regex number only

// for anynumber from zero to infinity
[RegularExpression("^[0-9]*$", ErrorMessage = "Enter Valid Number")] 

// for number greater than zero
[RegularExpression("^[1-9][0-9]*$", ErrorMessage = "Enter Valid Number")] 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #regex #number
ADD COMMENT
Topic
Name
7+4 =