Hey... I don’t have a regex wizard so am I NOT a gentleman?

Anyway... I've used REWizard (a while back) and can vouch for it... and
Claude. I haven’t used the other suggestion by Bobby Heath.

But I'd think this would be much easier and reusable than a regular
expression.

<cfscript>
function maskemail(email)
{
        name = listfirst(email, '@');
        tld = listlast(email, '.');
        mask = '';
        midlength = len(replace(replace(email, name, ''), tld, ''))-2;
        
        for(i=1; i LTE midlength; i=i+1)
        {
                mask = mask & '*';
        }
        
        maskedemail = listfirst(email, '@') & '@' & mask & '.' &
listlast(email, '.');
        return maskedemail;
}
</cfscript>
<cfoutput>#maskemail('[EMAIL PROTECTED]')#</cfoutput>


Personally I'd use this since it wouldn’t matter to me whether or not the
number of asterisks matched the number of characters...


<cfscript>
function maskemail(email)
{
maskedemail = listfirst(email, '@') & '@**********' & listlast(email, '.');
return maskedemail;
}
</cfscript>

<cfoutput>#maskemail('[EMAIL PROTECTED]')#</cfoutput> 




-----Original Message-----
From: Claude Schneegans [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 30, 2006 10:19 AM
To: CF-Talk
Subject: Re: Need regular expression in REReplace for email

 >>I work with a gentleman here, Adam Presley, who
wrote a pretty good app for constructing and testing
regular expressions.

I consider myself also as a gentleman, and I have such an application in 
CF online here :
http://www.contentbox.com/claude/REwizard/index.cfm?p=h

-- 
_______________________________________
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:258449
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to