Hmmm...
According to the definition I'm looking at, local-part consists of:
dot-atom / quoted-string / obs-local-part
dot-atom allows:
[CFWS] dot-atom-text [CFWS]
dot-atom-text allows:
1*atext *("." 1*atext)
atext allows:
[CFWS] 1*atext [CFWS]
and consists of:
ALPHA / DIGIT / ; Any character except controls.
That appears to sugggest that dot-atom allows comments containing
folding whitespace (CFWS).
quoted-string allows:
[CFWS] DQUOTE *([FWS] qcontent) [FWS] DQUOTE [CFWS]
You can recurse back up through the various definitions of each of those
if you want, but clealy folding whitespace (FWS) is permitted.
obs-local-part allows:
word *("." word)
Unfortunately, the obs bit in obs-local-part indicates that this is
obselete addressing, but that's what you're actually testing for with
your regex.
I think it's safe to say that your regex is probably RFC 822 compliant,
but that it is not RFC 2822 compliant. Unfortunately most mail servers
these days are RFC 2822 compliant, so you may run into issues with
people who simply copy their email address from Outlook to a web form.
Having said that, I don't believe that the regex syntax in CF will allow
you to create a truly RFC 2822 compliant regex in a single block. The
best I've managed is a 10 line script with 10 different regexes
progressively validating the address. Eventually I gave up because
customer support kept getting people who were using domains that weren't
strictly valid tld's.
I've now reverted to the lazy old:
reFindNoCase('^.+@.+\..{2,20}$')
It allows all sorts of crap through, but I've generally found that to be
more acceptable than a lot of customer support issues with people who
can't get their valid email address to work.
my 2p
Spike
Stephen Milligan
Team Macromedia - ColdFusion
Co-author 'Reality Macromedia ColdFusion MX: Intranets and Content
Management'
http://spikefu.blogspot.com
> -----Original Message-----
> From: Paul Johnston [mailto:[EMAIL PROTECTED]]
> Sent: 28 January 2003 15:07
> To: [EMAIL PROTECTED]
> Subject: RE: [ cf-dev ] Regular Expression for Email and
> Domain checking - it works!
>
>
> Spike,
>
> > Not wanting to rain on the parade, but are you sure that the
> > regex will not reject some valid email addresses with folding
> > whitespace inside commments?
> >
> > Also an email address of the form:
> >
> > "Paul Johnston" <[EMAIL PROTECTED]> is perfectly
> > valid according to rfc2822, but I think your regex would reject it.
> >
> > There may be a few other valid constructs that get rejected,
> > but those are two that spring immediately to mind.
>
> You're not raining on the parade. That's fine! You are
> right that it will not cope with folding whitespace, and
> therefore it doesn't entirely work within the specification.
> However, all I was wanting to write was a regular expression
> that would validate the full email address (ie the part of
> the specification that deals with "local-part").
>
> As I said in one of my emails about this, the scenario you
> mentioned above is not something that website programmers
> have to deal with very often. And most people realise that
> the important bit to check is the bit between angle brackets.
>
> I never said that it supported all of the functionality of
> rfc2822 but I did say that I had created the regex with
> rfc2822 in mind.
>
> To add in those extras wouldn't be too hard, but I don't
> think it's entirely necessary.
>
> That could be a next iteration of the function anyway. To
> test with or without folding whitespace. For now, let's
> stick at this!
>
> Paul
>
>
>
>
> --
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED] For human help, e-mail:
> [EMAIL PROTECTED]
>
>
>
--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]