NET 2.0 (C#) web form that contains a textbox for users to enter multiple e-mail addresses separated by semicolons.We need to validate that each individual e-mail address entered is a valid e-mail address format.Check out this correct regex to validate addresses, which is quite unpractical.This means that we can either be too strict or too lenient with our regex.A regex could obviously replace this entire function with roughly 5 lines of code if you're not picky.
Also, I agree with Gaby -- emails do accept so many valid characters, including ones we've never thought would be acceptable.
HTML One thing I know could be improved is where I repeat basically the same code twice to validate the characters in each section.
I am more interested in hearing if the way I've structured the function and sections could be done better, as the exercise for me was more about writing well-structured Java Script and getting familiar with some of the built-in functions than about writing a perfect validator (which is also the reason I didn't use Regex).
I didn’t really want to use a Regex because I wanted the code to be easy to understand when someone came to read it later, I knew whoever reading would know Java Script but wasn’t sure if they would know regexes that well.
Fw-300 #ya-qn-sort h2 /* Breadcrumb */ #ya-question-breadcrumb #ya-question-breadcrumb i #ya-question-breadcrumb a #bc .ya-q-full-text, .ya-q-text #ya-question-detail h1 html[lang="zh-Hant-TW"] .ya-q-full-text, html[lang="zh-Hant-TW"] .ya-q-text, html[lang="zh-Hant-HK"] .ya-q-full-text, html[lang="zh-Hant-HK"] .ya-q-text html[lang="zh-Hant-TW"] #ya-question-detail h1, html[lang="zh-Hant-HK"] #ya-question-detail h1 /* Trending Now */ /* Center Rail */ #ya-center-rail .profile-banner-default .ya-ba-title #Stencil . Bgc-lgr .tupwrap .comment-text /* Right Rail */ #Stencil .