What is RegularExpression:-
RegularExpression is also known as Regxp.by using RegularExpression First you have set some property of the RegularExpression are as follow
- Add a RegularExpressionValidator control to your page.
- Set the ControlToValidate property to indicate which control to validate.
- Set the ValidationExpression property to an appropriate regular expression.
- Set the ErrorMessage property to define the message to display if the validation fails.
Description:-
in this example we explain all validation like email validation,phone number or Mobile number validation,URL validation,Zipcode,validation Password etc.......
we all know that the Validation is main part in every place when the Form data is submited.
For exaple:- suppose you enter your Name in Digit and your Mobile Number in String Format is not a proper way so for this Reason we can use Validation Before Our data is Submited to the Server.
through validation we can also reduce the load in server because the your data validation is checked in Clientside and then after it is valid then and then submited to server for further process otherwise you show a validation message like enter mobile number 10 digit only or your Email id is not Valid.
so through validation you can built your website very smoothly.