Thanks to all that replied!

-----Original Message-----
From: Jake Churchill [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 14, 2007 3:16 PM
To: CF-Talk
Subject: RE: strip all non-numeric characters from a string

I think you can also do

num = REReplace(num, "\D", "", "all");

_____ 

Jake Churchill 
CF Webtools 
11204 Davenport, Ste. 200b 
Omaha, NE  68154 
http://www.cfwebtools.com 
402-408-3733 x103 


-----Original Message-----
From: Barney Boisvert [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 14, 2007 3:10 PM
To: CF-Talk
Subject: Re: strip all non-numeric characters from a string

num = REReplace(num, "[^0-9]+", "", "all");

cheers,
barneyb

On 8/14/07, Matthew Smith <[EMAIL PROTECTED]> wrote:
> We are having an issue with users entering their phone numbers and credit
card info.  How would I strip a string of all non-numeric characters.  I'm
sure it involves rereplace() but I'm no good with regular expressions.
Thanks for any help.
>
> Right now for the credit card I have this which just strips out spaces and
dashes:
> <cfset attributes.billingCardNumber =
replace(attributes.billingCardNumber, " ", "", "all")>
> <cfset attributes.billingCardNumber =
replace(attributes.billingCardNumber, "-", "", "all")>
>
-- 
Barney Boisvert
[EMAIL PROTECTED]
http://www.barneyb.com/

Got Gmail? I have 100 invites.





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:286203
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