Regular Expression Help

S

sam

Hello,
We have a textbox on a web form (ASP.NET 2.0 - C#) that is for end-users to
enter e-mail address(es). The valid entries are:

(e-mail address removed)
(e-mail address removed);[email protected];[email protected] (notice no space after
the semicolon)
(e-mail address removed); (e-mail address removed); (e-mail address removed) (notice the space
after the semicolon)

Basically, the user can enter 1 e-mail address or more than 1 e-mail address
separated by a semicolon.

Can the RegularExpressionValidator control handle this situation?
If not, is there another way to validate this?

Thanks!
 
A

agapeton

To avoid obfuscating the code, I would do this custom. As in split on
all the e-mail separators (most people allow for space, camma,
semicolor, and new line) and then regexp against each. If one fails,
they all fail.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top