473,785 Members | 2,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help validating email addresses

SAL
I am using a RegularExpressi onValidator control on my ASP page, and I have
the ValidationExpre ssion 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
ValidationExpre ssion 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,

Feb 27 '06 #1
4 2767
^(\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 RegularExpressi onValidator control on my ASP page, and I have
the ValidationExpre ssion 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
ValidationExpre ssion 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,

Feb 27 '06 #2
SAL
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 RegularExpressi onValidator control on my ASP page, and I have
the ValidationExpre ssion 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
ValidationExpre ssion 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,

Feb 27 '06 #3
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 RegularExpressi onValidator control on my ASP page, and I have
the ValidationExpre ssion 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
ValidationExpre ssion 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,

Feb 27 '06 #4
SAL
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 RegularExpressi onValidator control on my ASP page, and I have
> the ValidationExpre ssion 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
> ValidationExpre ssion 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,
>

Feb 27 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2267
by: John | last post by:
What are the methods used in validating email addresses in Windows i.e what are the replacement for getmxrr? does anyone have an example? Thank you John
17
4928
by: Sue | last post by:
<html> Is there someone here that can help me validate the period as the fourth from the last character in an email address. There is other information and validation on the form I have to do but the period in the email address is the only part I am having problems with. I have posted part of my code below. Any help would be greatly appreciated. THANKS !
117
11894
by: Steevo | last post by:
Any suggestions as to the best programs for cloaking email addresses? Many thanks -- Steevo
2
13181
by: orekinbck | last post by:
Hi There I have spent alot of time trying to get a masked text box to validate e-mails, but with no success. Mainly because I can't figure out how to account for the wide variety of different e-mail addresses, for example: billwallis@hta.com bill.wallis@hta.com billwallis@hta.com.au bill.wallis@hta.com.au
4
1301
by: KB | last post by:
I realised that if I use datagrid and datasource is a datatable, when I created a new row and while on that row I exit the datagrid (ie. without moving into the next row) and focus onto another control, that new row is not recorded (check it at the datagrid.validating event). However, if I use down arrow key to move to the next row (without keying any data) and exit, the new row is recorded in the datatable. can anyone please advise if I...
4
1409
by: Stephen | last post by:
I volunteer for a non-for profit group and they have alot of names in a multiple databases. the problem is that some people are in multiple databases. and if they send out a mailing from multiple databases some people get 2 and 3 of the same thing. my idea was to either make or find a program that has everyone is 1 database and then make the people part of multiple groups. (ex: bill is part of group a and b and im doing a mailing from both...
4
1830
by: John | last post by:
Hi I have this problem that client users enter emails incorrectly due to type and either the domain name is invalid (Microsot.com instead of Microsoft.com) or the syntax of the email (user'domain.com instead of user@domain.com). Is there any way to ensure a) email syntax is correct and b) reverse dns or any other check to highlight invalid domain names? Thanks
23
2880
by: codefire | last post by:
Hi, I am trying to get a regexp to validate email addresses but can't get it quite right. The problem is I can't quite find the regexp to deal with ignoring the case james..kirk@fred.com, which is not valid. Here's my attempt, neither of my regexps work quite how I want: import os import re
3
1561
by: Praveen | last post by:
looking for regex pattern for validating emailid emailid can have a-z 0-9 - _ . (a to z, 0 ot 9, hyphen,undercore, dot) here is a sample which I got from net which doesnt allow hyphen(-) string pattern=@"^*(+)*(+(+)*)?@*\.(*(\.*)?)$"; Modified the same t o
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10325
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10148
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3646
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.