473,497 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Regular Expression for validate email address

66 New Member
Hello.

I have this Regular Expression for validate email address in my form:

[php]var re = new RegExp("^[a-z][a-z0-9]*\\.[a-z][a-z0-9]*(\-WEDNES)?@Names\\.com$", "i");[/php]

Why invalid this email address ??? :

mark.d'ausilio-WEDNES@Names.com

Is the ' ?
The ' can exist but is not obligatory...

Can you help me?
Thanks
Apr 30 '08 #1
7 2292
pronerd
392 Recognized Expert Contributor
Why invalid this email address ??? :

mark.d'ausilio-W
The regular expression allows for letters and numbers, but that address has special characters in it. I am not sure if " ' " is allowed my most email servers. Even if it works in your specific setup it may not work when others try to send email to you, so it would be a good idea to change it.
Apr 30 '08 #2
Mike1961
66 New Member
The regular expression allows for letters and numbers, but that address has special characters in it. I am not sure if " ' " is allowed my most email servers. Even if it works in your specific setup it may not work when others try to send email to you, so it would be a good idea to change it.
these emails are business and assigned by the webmaster for name and surname employee... can not be changed...
Apr 30 '08 #3
pronerd
392 Recognized Expert Contributor
these emails are business and assigned by the webmaster for name and surname employee... can not be changed...
So what? None of that changes what I already told you. Your admins email setup choices do change how regular expressions work. If your emails are going to have special characters then your expression will have to allow them to valid them.
Apr 30 '08 #4
Mike1961
66 New Member
So what? None of that changes what I already told you. Your admins email setup choices do change how regular expressions work. If your emails are going to have special characters then your expression will have to allow them to valid them.
How to change regular expression to validate character ' ?
Apr 30 '08 #5
acoder
16,027 Recognized Expert Moderator MVP
If you must, add the single quote in the [a-z0-9] part, i.e. [a-z0-9']
May 1 '08 #6
Mike1961
66 New Member
If you must, add the single quote in the [a-z0-9] part, i.e. [a-z0-9']
many thanks !!!!
working !!!
May 2 '08 #7
acoder
16,027 Recognized Expert Moderator MVP
You're welcome. Never doubted that it wouldn't ;)
May 2 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

6
489
by: JohnSouth | last post by:
Hi I've been using a Regular expression to test for valid email addresses. It looks like: \w+(\w+)*@\w+(\w+)*\.\w+(\w+)* I've now had 2 occassions where it has rejected and email address...
5
3085
by: Ryan | last post by:
HELLO I am using the following MICROSOFT SUGGESTED (somewhere on msdn) regular expression to validate email addresses however I understand that the RFP allows for "+" symbols in the email address...
1
567
by: sam | last post by:
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: name@company.com...
2
2760
by: Ramesh | last post by:
I have a reguar expression syntax that works fine when used in a RegularExpressionValidation control. If I use the exact same regular expression using System.Text.RegularExpressions.Regex to...
0
7121
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7162
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,...
0
7375
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4899
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...
0
4584
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...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1411
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 ...
1
650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
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...

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.