From: BORKMAN Lee <[EMAIL PROTECTED]>
> This code looks doubtful to me, for a few reasons:
Most of it is okay...
> (^[[:alnum:]]([._-]?[[:alnum:]]+)*+\@[[:alnum:]]+([.-]?[[:alnum:]]+)*\.[[:al
> pha:]]{1,4}$)
> ^ no multipler for the opening character? Does that mean only
> a single alnum allowed before punctuation? I would expect a "+" inserted
> here.
All this means is that the first character must be alphanumber. From that
point on, 0 or more characters (the *) can be either .,_,- or 1 or more
additional Alphanumberics.
Oh - I know I have seen emails with + in them - that's at least one thing
that is missing from the [._-] . Also, I'm pretty certain I've seen
commas... There are actually RFCs (the internet standards description
documents) on what is valid. However note - I know that a similar
type of construct for looking to see if the input string has components
relatively valid for email addresses is considerably more complex, so
I suspect that you are opting for a 'mild' formatting validation pass.
Since the string really isn't a valid email address after passing this
test (since there is no way to tell for certain whether [EMAIL PROTECTED] is
a _real_ user at a _real_ site), I'm guessing the original poster is just
trying to be a bit helpful to his/her users.
> ^ what's the significance of the "?". I'm not familiar
>with "?" as a multiplier. Looks like it should be left out.
? provides the ability to say "this string might be present - or might not".
> ^ what's the "+" for? What is is
>modifying? Could be left out?
I agree here. I mentioned earlier that it doesn't look right.
> On the other hand, I've never had much luck trying to understand other
> people's REs, so I may be talking garbage. Anyone who can explain this RE
> to me, please feel free!!
I love regular expressions. I'm always glad to help out...
--
Never apply a Star Trek solution to a Babylon 5 problem.
Larry W. Virden <mailto:[EMAIL PROTECTED]> <URL: http://www.purl.org/NET/lvirden/>
Even if explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.
-><-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists