> <cfset sPattern =
> "([a-z0-9][-._a-z0-9]*)[EMAIL PROTECTED],1}([a-z0-9][-_a-z0-9]
> *\.)+[a-z]{2,7}"
> />
> return IIF(REFindNoCase(sFormatPattern, str) EQ 1, true,
> false);


> And similarly in the Javascript:

> var emailFilter =
> /([a-zA-Z0-9][-._a-zA-Z0-9]*)[EMAIL PROTECTED],1}([a-zA-Z0-
> 9][-_a-zA-Z0-9]*\.)+[a-zA-Z]{2,7}/g;
> return emailFilter.test(sEmail);

Not sure about the hanging, but for any reges that begins at the start
of the string and ends at the end of the string (like an email
address) I would think you should definately always have ^ at the
beginning and $ at the end of the expression.

Also I believe [a-zA-Z0-9] can be replaced with \w (or [[:alnum:]] in
CF if you want to use the widely un-used standard - I like the posix
character classes because they're a good semantic, i.e. they're
descriptive unlike any of the other syntaxes)...

You can also make your javascript regex case insensitive by adding "i"
on the end... you don't need the "g" because you're not replacing
anything... so... /expression/i should help you out there...

You've got an extra * in there... where your expressions both have
]*)* ... drop the * after the ) should just be ]*) -- that might have
something to do with the hanging issue -- I wouldn't have expected as
such, but it's possible...

You've also got a {1,1} you don't need... {1,1} is the default for any
character, so @{1,1} is the same as @

The parenthesis in general look unnecessary... Are you using those for
replacement later in the script? If not, then remove the parenthesis
all-together...

hth



s. isaac dealey     954.522.6080
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://www.fusiontap.com
http://coldfusion.sys-con.com/author/4806Dealey.htm


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
This list and all House of Fusion resources hosted by CFHosting.com. The place 
for dependable ColdFusion Hosting.
http://www.houseoffusion.com/banners/view.cfm?bannerid=11

Message: http://www.houseoffusion.com/lists.cfm/link=i:21:879
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/21
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:21
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.21
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to