Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Help validating email addresses

Reply
Thread Tools

Help validating email addresses

 
 
=?Utf-8?B?U0FM?=
Guest
Posts: n/a
 
      02-27-2006
I am using a RegularExpressionValidator control on my ASP page, and I have
the ValidationExpression property set to "Internet E-mail Address". The
email address is valiated when the user puts in a email addess in the TextBox.

This works fine until I have multiple email addresses. How can I validate
multiple e-mail addresses seperated by a "," or ";"? The following
ValidationExpression will validate up to 2 email addresses but not anymore:

\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*([,;]\s*\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)*

Any suggestion would be helpful. The number of emails could be infinite,
but I think the max will be 10 at most.

Thanks,

 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
Guest
Posts: n/a
 
      02-27-2006
^(\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*\b([,;]\s?)?)*$
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com


"SAL" wrote:

> I am using a RegularExpressionValidator control on my ASP page, and I have
> the ValidationExpression property set to "Internet E-mail Address". The
> email address is valiated when the user puts in a email addess in the TextBox.
>
> This works fine until I have multiple email addresses. How can I validate
> multiple e-mail addresses seperated by a "," or ";"? The following
> ValidationExpression will validate up to 2 email addresses but not anymore:
>
> \w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*([,;]\s*\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)*
>
> Any suggestion would be helpful. The number of emails could be infinite,
> but I think the max will be 10 at most.
>
> Thanks,
>

 
Reply With Quote
 
 
 
 
=?Utf-8?B?U0FM?=
Guest
Posts: n/a
 
      02-27-2006
Thanks Phillip.

For my future reference where can I look to find out what all these switches
mean?

"Phillip Williams" wrote:

> ^(\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*\b([,;]\s?)?)*$
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "SAL" wrote:
>
> > I am using a RegularExpressionValidator control on my ASP page, and I have
> > the ValidationExpression property set to "Internet E-mail Address". The
> > email address is valiated when the user puts in a email addess in the TextBox.
> >
> > This works fine until I have multiple email addresses. How can I validate
> > multiple e-mail addresses seperated by a "," or ";"? The following
> > ValidationExpression will validate up to 2 email addresses but not anymore:
> >
> > \w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*([,;]\s*\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)*
> >
> > Any suggestion would be helpful. The number of emails could be infinite,
> > but I think the max will be 10 at most.
> >
> > Thanks,
> >

 
Reply With Quote
 
=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
Guest
Posts: n/a
 
      02-27-2006
The only references I have ever used on Regular Expressions were these ones
on the MSDN
http://msdn.microsoft.com/library/de...AsLanguage.asp

http://msdn.microsoft.com/library/de...6f58358c0e.asp

There are however some more popular sites that I saw their links posted on
this newsgroup frequently such as http://www.regexplib.com/

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com


"SAL" wrote:

> Thanks Phillip.
>
> For my future reference where can I look to find out what all these switches
> mean?
>
> "Phillip Williams" wrote:
>
> > ^(\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*\b([,;]\s?)?)*$
> > --
> > HTH,
> > Phillip Williams
> > http://www.societopia.net
> > http://www.webswapp.com
> >
> >
> > "SAL" wrote:
> >
> > > I am using a RegularExpressionValidator control on my ASP page, and I have
> > > the ValidationExpression property set to "Internet E-mail Address". The
> > > email address is valiated when the user puts in a email addess in the TextBox.
> > >
> > > This works fine until I have multiple email addresses. How can I validate
> > > multiple e-mail addresses seperated by a "," or ";"? The following
> > > ValidationExpression will validate up to 2 email addresses but not anymore:
> > >
> > > \w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*([,;]\s*\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)*
> > >
> > > Any suggestion would be helpful. The number of emails could be infinite,
> > > but I think the max will be 10 at most.
> > >
> > > Thanks,
> > >

 
Reply With Quote
 
=?Utf-8?B?U0FM?=
Guest
Posts: n/a
 
      02-27-2006
Great. Thanks again Phillip.

That website you referenced is where I first found somewhat what I was
trying to do. After I sent my question out to this discussion board I got it
working. However, you solution was a better and not as long as mine so I use
it instead. I made a slight modification to it, so it would accept IP
addresses in the domain as well.

Thanks again.

"Phillip Williams" wrote:

> The only references I have ever used on Regular Expressions were these ones
> on the MSDN:
> http://msdn.microsoft.com/library/de...AsLanguage.asp
>
> http://msdn.microsoft.com/library/de...6f58358c0e.asp
>
> There are however some more popular sites that I saw their links posted on
> this newsgroup frequently such as http://www.regexplib.com/
>
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "SAL" wrote:
>
> > Thanks Phillip.
> >
> > For my future reference where can I look to find out what all these switches
> > mean?
> >
> > "Phillip Williams" wrote:
> >
> > > ^(\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*\b([,;]\s?)?)*$
> > > --
> > > HTH,
> > > Phillip Williams
> > > http://www.societopia.net
> > > http://www.webswapp.com
> > >
> > >
> > > "SAL" wrote:
> > >
> > > > I am using a RegularExpressionValidator control on my ASP page, and I have
> > > > the ValidationExpression property set to "Internet E-mail Address". The
> > > > email address is valiated when the user puts in a email addess in the TextBox.
> > > >
> > > > This works fine until I have multiple email addresses. How can I validate
> > > > multiple e-mail addresses seperated by a "," or ";"? The following
> > > > ValidationExpression will validate up to 2 email addresses but not anymore:
> > > >
> > > > \w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*([,;]\s*\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)*
> > > >
> > > > Any suggestion would be helpful. The number of emails could be infinite,
> > > > but I think the max will be 10 at most.
> > > >
> > > > Thanks,
> > > >

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to implement a firewall for Windows platform that blocks based on Mac addresses instead of IP addresses cagdas.gerede@gmail.com C Programming 1 12-07-2006 04:30 AM
Physical Addresses VS. Logical Addresses namespace1 C++ 3 11-29-2006 03:07 PM
Bulk Email online download 238 million email addresses Memo Computer Support 0 09-28-2004 08:33 AM
238 Million email addresses download online your email list Memo Computer Support 0 09-19-2004 02:36 PM
validating IP addresses using XML Schema UndoMiel XML 8 08-08-2004 05:17 AM



Advertisments