One issue with that is that ListLen() doesn't work too well when the
delimiter used shows up twice in a row. For example blah@@blah.com would, I
believe, return ListLen() of 2 - it wouldn't see there being a list entry
between the @'s.

I've been having this same issue with a project, bogus emails getting past
validation. I haven't yet fully tested this solution... basically the idea
is, do a Find() for an @, then do another Find() for an @ from the position
of the last find, plus 1. If the second Find() returns a value, there's one
too many @'s.

At 09:13 PM 1/6/2004, you wrote:
>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