I'd recommend removing everything but the digits, and regex is perfect for
that:
<cfset phone = reReplace(phone, "[^0-9]", "", "all")>

Store the resulting value, and then format it as you desire when displaying.

On Tue, Apr 22, 2008 at 3:34 AM, Azadi Saryev <[EMAIL PROTECTED]> wrote:

> rereplace() is looking for a regexp, while you are giving it a literal
> string to find and replace...
> either use replace() function, or give rereplce() a regexp to match the
> characters you want to remove.
> something like rereplace(phone, "[\(\)\.-]", "", "all")
>
> Azadi Saryev
> Sabai-dee.com
> http://www.sabai-dee.com/
>
>
>
> [EMAIL PROTECTED] wrote:
> > I've got different phone number formats due to an csv import.  I'm
> trying to remove
> > phone number formating from the database and just have the numbers.  As
> I parse
> > through my phone numbers from a query, this code is throwing errors.
>  I'm trying to
> > get rid of ')', '(', '.' and '-'
> >
> >             <cfset phone = rereplace(phone, "(", "", "all") />
> >             <cfset phone = rereplace(phone, ")", "", "all") />
> >             <cfset phone = rereplace(phone, ".", "", "all") />
> >             <cfset phone = rereplace(phone, "-", "", "all") />
> >
> > Thanks
> >
> > D
> >
> >
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

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

Reply via email to