How to validate a mobile number textbox and email textbox using regular expressions in C#?
I want to validate these first at the front end itself so that the database doesn’t receive any invalid input or rather even checks for it.
I am using Windows Forms.
You can use
System.Text.RegularExpressionI’ll give you an example for e-mail validation
then declare a regular expression like
and say your e-mail textbox is
txtEmailthen write,
Update
Not an expert on regular expressions,
Here’s the link to Regular expression to validate e-mail
you can find more details about the regEx from the link provided.