It will work on the whole string, not just the back reference.
Ryan, I don't think it's something that can be done with CF, but it might be possible to use Java's regex instead. Have a look at these two blog entries which might help: http://www.bennadel.com/index.cfm?dax=blog:301.view http://www.bennadel.com/blog/191-REReplace-Java-Function-Pointers-Freakin-Sexy-.htm > On 11/2/06, Ryan Mitchell <[EMAIL PROTECTED]> wrote: > > Hopefully this should be an easy and quick answer. > > > > I want to call a function on a regex backreference, ie: > > > > REreplace(string,regex,function('\1'),'ALL'); > > > > is this possible? I've tried every imaginable combination to make it > work, and its just not happening!!! > > I don't think you can do that directly. You can, however, do > something like this: > > <cfset backref = REReplace ( string, regex, '\1', 'ALL' ) /> > <cfset out = function ( backref ) /> > > An extra step, but it will work. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:258820 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4