CF evaluates the replace string *before* sending it to the regular expression engine. Therefore, it's trying to find the struct key named '\1' which is not legal. There are several ways to get around this, but they all basically boil down to doing it in two steps.
--BenD Johnny Le wrote: > I tried to do this: > > <cfset thestring = "user.list&id={id}&username={username}"/> > <cfset reReplace(thestring,'\w*{(\w+)}','#qryUser[\1]#','all')/> > > but I got an error. Is it possible to use \1 as a variable? I even tried > '#evaluate("qryUser[\1]")# but it doesn't work. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion 8 - Build next generation apps today, with easy PDF and Ajax features - download now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:294152 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4