Regular expression for validating email address
Fortunately you don’t have to create these patterns, you can find any pattern here, Implement user validation using regex and C# In this example I’ll show you how to use regex class to validate an email, zip code and phone number field within a windows form app.
A regular expression is sometimes called regex or regexp. \.[a-z A-Z]$ “ matches an email address, so you can use this pattern to validate if a specific string is equals to a valid email address or not. Regual Expressions namespace So let’s start, Now you can fill the fields then click check button, if there is any invalid data a message box will appear and tell you. Using this reference the email address to be validated is passed as a parameter in the matcher method of the Matcher class which returns either true or false. Email2 does not contain the ‘@’ symbol which is not a valid email address format.