Here is a hack work around using REFind to return a struct of arrays
containing the match locations then doing string manipulation to replace the
parts you want to replace. The downside is it will only work on the first
occurrence of the match in the string. I can not find any other way to make
the regex substituion work without inserting a comma. Which in the end may
be acceptable in your case. Welcome to the world of CF flavored RegEx.
<cfset testString = "house in clapham 200k with garden">
<cfset pattern = "(\d+)(k)">
<cfset sMatchPos = refindNoCase(pattern,testString,1,"True")>
<cfset newstring =
removeChars(testString,sMatchPos['pos'][3],aMatchPos['len'][3])>
<cfset newstring = insert("000",newstring,sMatchPos['pos'][3]-1)>
<cfoutput>#newstring#"</cfoutput>
Wil Genovese
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317884
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4