Click here to Skip to main content
14,603,787 members

Email Address Validation: Explained in Detail, Code for Production Quality WPF TextBox

Rate this:
3.95 (8 votes)
Please Sign up or sign in to vote.
3.95 (8 votes)
30 Mar 2020Public Domain
A WPF TextBox which can validate email addresses depending on your needs, plus detailed description of the many ways a valid email address may look like.
Validating email addresses is difficult, because the specification what constitutes a valid email address allows for an immense variety. Trying to translate these specifications into proper Regex leads to huge and complicated expressions which still might not cover all cases. This article describes how email address validation can be reasonably done and provides a production quality code WPF TextBox, including letting the user enter only valid keystrokes, controlling if an email address must be entered (Required field) and alerting the user if he tries to close the window without saving the changes made.



This article, along with any associated source code and files, is licensed under A Public Domain dedication


About the Author

Peter Huber SG
Software Developer (Senior)
Singapore Singapore
Retired SW Developer from Switzerland living in Singapore

Interested in WPF projects.

Comments and Discussions

Tagged as


10 bookmarked