Sorry.. MIDDLE eight.. Now it gets ugly with regEx..

<cfset 
masked=REReplace(ccnum,"([0-9]{4})[0-9]+([0-9]{4})","\1#repeatString('*',8)#\2")>

-Ryan
-----Original Message-----
From: Ryan Emerle 
Sent: Tuesday, January 07, 2003 10:47 AM
To: CF-Talk
Subject: RE: Replacing characters in a string


Yet another way.. With regular expressions:

<cfset maskDigits=8>
<cfset masked=REReplace(CCnum,"^[0-9]{#maskDigits#}",repeatString("*",maskDigits))>

-Ryan

-----Original Message-----
From: Ryan Mitchell [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 07, 2003 7:56 AM
To: CF-Talk
Subject: Replacing characters in a string


This should be a simple enough one...

I have a credit card number, 16 digits long, and I want to star (*) out the
middle 8. How do I do this?

TIA
Ryan




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to