Shouldn't you be writing "200,000" (or "200 000") anyway?

So use "\1,000" (or "\1 000")?



Alternatively, use Java regex so you can do lookbehinds, to effectively just
replace K with 000. ie:
<cfset Text = JREReplace(Text,'(?<=[0-9]+)K','000','ALL')/>

(You can get the JREReplace udf from Ben Nadel's site)



On Mon, Mar 10, 2008 at 12:26 PM, Adrian Lynch <[EMAIL PROTECTED]>
wrote:

> I need to change a string like the following:
>
> "house in clapham 200K with garden"
>
> into
>
> "house in clapham 200000 with garden"
>
> So replacing the "K" with "000".
>
> I came up with:
>
> (\d*?)K
>
> But then in trying to replace the match with:
>
> \1000
>
> Or \1 and three zeros, it falls foul because it's looking for the 1000th
> sub
> expression.
>
> Trying to escape the first zero doesn't work because \0 returns the whole
> matched expression.
>
> Any ideas?
>
> I can do two operations on it and be done but I'd like to know if there's
> something I'm missing.
>
> Ta.
>
> Adrian
>
>
> 

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

Archive: http://www.houseoffusion.com/groups/RegEx/message.cfm/messageid:1134
Subscription: http://www.houseoffusion.com/groups/RegEx/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.21

Reply via email to