How about this? Basically, an email address can be seen as a list using the @ as
a delimiter. If the listlen is 2, then it's legal. If not, then it's illegal.
How illegal is determined below but a simple CFIF on the listlen() should be
enough. I think that's what I do in my spam checker, or used to before I parsed
the entire email address into it's component parts. Let me see if I can send you
that.

<CFSWITCH _expression_="#ListLen(address, '@')#">
<CFCASE value="1">No @, invalid email</CFCASE>
<CFCASE value="2">1 @, good email</CFCASE>
<CFDEFUALTCASE>more than 1 @, very bad email</CFDEFAULTCASE>
</CFSWITCH>

> Can someone tell me if this should work? I'm trying to look for
> duplicate @ signs in some email addresses. I was using the following
> code but it doesn't seem to work. According to the docs that should find
> 2 - 4 occurrences of the @ symbol but it always returns 0 even though I
> know there is at least one email that has multiples.
>
> <cfset getDupes = ReFind("@{2,4}", embl_email)>
>
> Thanks,
> Ben
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to