473,406 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Built-in RegularExpressionValidator email regex

I was just wondering if there is a reason (maybe a RFC requirement?) that the
built in email address regular expression for the RegularExpressionValidator
in ASP.NET doesn't support email aliases ending in a dash.

For example, the following address will not validate:
te***********@hotmail.com

Thanks,

-Steven
Nov 19 '05 #1
3 2416
Steven,
If you are familiar with RFC's, why not just look it up? :) my typically
answer to this would be to look up the RFC..teach a man how to fish
afterall..

Anyways, I'd still try to help since RFCs are a pain in the rear and I just
spent 10 minutes trying to follow it because I wanted to know as well.

RFC 2822..
addr-spec = local-part "@" domain
so we are interested in local-part

local-part = dot-atom / quoted-string / obs-local-part
we'll look at dot-atom since that's the most common and we don't want to
quote our email adrress

dot-atom = [CFWS] dot-atom-text [CFWS]
ignore the CFWS (folding whitespace w/comments), so we want the
dot-atom-text

dot-atom-text = 1*atext *("." 1*atext)
so we want atext

atext = ALPHA / DIGIT / ; Any character except controls,
"!" / "#" / ; SP, and specials.
"$" / "%" / ; Used for atoms
"&" / "'" /
"*" / "+" /
"-" / "/" /
"=" / "?" /
"^" / "_" /
"`" / "{" /
"|" / "}" /
"~"
note that dash isn't in the list, but maybe it's under ALPHA

item-name = ALPHA *(["-"] (ALPHA / DIGIT))
BINGO! We have a dash, but if you have a dash, it must clearly be followed
by another ALPHA or Digit

I could have followed that wrong (and there certainly are other paths) but I
think it's right.

hope that hels ;)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Steven Berkovitz" <mb****@community.nospam> wrote in message
news:33**********************************@microsof t.com...
I was just wondering if there is a reason (maybe a RFC requirement?) that
the
built in email address regular expression for the
RegularExpressionValidator
in ASP.NET doesn't support email aliases ending in a dash.

For example, the following address will not validate:
te***********@hotmail.com

Thanks,

-Steven

Nov 19 '05 #2
Karl,

Thanks for taking the time to explain this.

I guess my next question is (not for you), why is hotmail allowing this?
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:ex**************@TK2MSFTNGP10.phx.gbl...
Steven,
If you are familiar with RFC's, why not just look it up? :) my typically
answer to this would be to look up the RFC..teach a man how to fish
afterall..

Anyways, I'd still try to help since RFCs are a pain in the rear and I
just spent 10 minutes trying to follow it because I wanted to know as
well.

RFC 2822..
addr-spec = local-part "@" domain
so we are interested in local-part

local-part = dot-atom / quoted-string / obs-local-part
we'll look at dot-atom since that's the most common and we don't want to
quote our email adrress

dot-atom = [CFWS] dot-atom-text [CFWS]
ignore the CFWS (folding whitespace w/comments), so we want the
dot-atom-text

dot-atom-text = 1*atext *("." 1*atext)
so we want atext

atext = ALPHA / DIGIT / ; Any character except controls,
"!" / "#" / ; SP, and specials.
"$" / "%" / ; Used for atoms
"&" / "'" /
"*" / "+" /
"-" / "/" /
"=" / "?" /
"^" / "_" /
"`" / "{" /
"|" / "}" /
"~"
note that dash isn't in the list, but maybe it's under ALPHA

item-name = ALPHA *(["-"] (ALPHA / DIGIT))
BINGO! We have a dash, but if you have a dash, it must clearly be
followed by another ALPHA or Digit

I could have followed that wrong (and there certainly are other paths) but
I think it's right.

hope that hels ;)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Steven Berkovitz" <mb****@community.nospam> wrote in message
news:33**********************************@microsof t.com...
I was just wondering if there is a reason (maybe a RFC requirement?) that
the
built in email address regular expression for the
RegularExpressionValidator
in ASP.NET doesn't support email aliases ending in a dash.

For example, the following address will not validate:
te***********@hotmail.com

Thanks,

-Steven


Nov 19 '05 #3
Well, there is a quoted-string variant to the dot-atom path we explored.
Reading the specs, it's my belief that quoted-string would allow for a
local-addr to be terminated with a - if it's quoted, ala "test-address-"
(with the quotes actually there).
qtext = NO-WS-CTL / ; Non white space controls

%d33 / ; The rest of the US-ASCII
%d35-91 / ; characters not including "\"
%d93-126 ; or the quote character

qcontent = qtext / quoted-pair

quoted-string = [CFWS]
DQUOTE *([FWS] qcontent) [FWS] DQUOTE
[CFWS]a dash is decimal 45, so it falls in the
%d35-91Perhaps that's what hotmail does.Karl-- MY ASP.Net
tutorialshttp://www.openmymind.net/"Steven Berkovitz"
<mb****@community.nospam> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Karl,

Thanks for taking the time to explain this.

I guess my next question is (not for you), why is hotmail allowing this?
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:ex**************@TK2MSFTNGP10.phx.gbl...
Steven,
If you are familiar with RFC's, why not just look it up? :) my typically
answer to this would be to look up the RFC..teach a man how to fish
afterall..

Anyways, I'd still try to help since RFCs are a pain in the rear and I
just spent 10 minutes trying to follow it because I wanted to know as
well.

RFC 2822..
addr-spec = local-part "@" domain
so we are interested in local-part

local-part = dot-atom / quoted-string / obs-local-part
we'll look at dot-atom since that's the most common and we don't want to
quote our email adrress

dot-atom = [CFWS] dot-atom-text [CFWS]
ignore the CFWS (folding whitespace w/comments), so we want the
dot-atom-text

dot-atom-text = 1*atext *("." 1*atext)
so we want atext

atext = ALPHA / DIGIT / ; Any character except controls,
"!" / "#" / ; SP, and specials.
"$" / "%" / ; Used for atoms
"&" / "'" /
"*" / "+" /
"-" / "/" /
"=" / "?" /
"^" / "_" /
"`" / "{" /
"|" / "}" /
"~"
note that dash isn't in the list, but maybe it's under ALPHA

item-name = ALPHA *(["-"] (ALPHA / DIGIT))
BINGO! We have a dash, but if you have a dash, it must clearly be
followed by another ALPHA or Digit

I could have followed that wrong (and there certainly are other paths)
but I think it's right.

hope that hels ;)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Steven Berkovitz" <mb****@community.nospam> wrote in message
news:33**********************************@microsof t.com...
I was just wondering if there is a reason (maybe a RFC requirement?) that
the
built in email address regular expression for the
RegularExpressionValidator
in ASP.NET doesn't support email aliases ending in a dash.

For example, the following address will not validate:
te***********@hotmail.com

Thanks,

-Steven



Nov 19 '05 #4

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

Similar topics

1
by: JimmyT | last post by:
I just configured and installed 2.3.4 and noticed there is no datetime module. I noticed there is a datetimemodule.c file that did not get built (ie no object file). Is there something I need to...
0
by: Andrew Crook | last post by:
does MYSQL have a quota built into it! I need it limit the size of each database AndiC
1
by: Mark | last post by:
Is there a way to execute a statement that is built dynamically by a .NET application. For example I have a loop that is reading values from a database and I want to do something like the...
4
by: Yasutaka Ito | last post by:
Hi, Is there a way to determine which version of .NET Framework any given assembly is built with? thanks! -Yasutaka
1
by: William | last post by:
Looking for a pre built dotnet corporate or small business website template.
1
by: William | last post by:
Looking for a pre built dot net website for consulting business. I am trying to put up a quick business web for a dot net frame work. I have a provider already. I am trying to save time. Any...
1
by: Daniel | last post by:
is there any way to get to a unique build verion of an assembly at runtime? e.g. a version that is unique to the time that the assembly was built?
0
by: anthony Lichnewsky | last post by:
Hi, I have here a huge bunch of cygwin-built dlls using heavily posix api calls, and I wanted to know how to link them to some VC .NET library wrapper (using microsoft C runtime libraries this...
48
by: meyer | last post by:
Hi everyone, which compiler will Python 2.5 on Windows (Intel) be built with? I notice that Python 2.4 apparently has been built with the VS2003 toolkit compiler, and I read a post from Scott...
3
by: drewj840 | last post by:
I built a Windows service that sweeps a set of folders every 60 seconds and puts the files into a SQL Server database. I am creating a second service that will delete this set of folders and recreate...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.