Pattern#2 will match for string which are Natural Numbers.
For those situation i wrote my own function which handles all inconveniences of other functions and which is not depending on regular expressions.
Find the below sample screen shot for validating the fields before saving the data Img 3: Validation method Here I have validated the fields using the Boolean method, If all the field values are entered properly it will return true, other wise it will return false and will display an error message.
The source code shows how to use Regular Expressions in C#.
The code Functions written for Validation Alphabet, Alpha Numeric, Integer, Postive Integer, Floating point numbers.
You just cut copy these functions and use in any program.