Hello all.
I am trying to replace some text in a variable via the use of the REReplaceNoCase function:
<cfset MyVariable = REReplaceNoCase(MyVariable,"(href="")([A-Z0-9])","\1#cgi.script_name#?#Path#\2","ALL")>
This is designed to change the any hyperlinks contained in MyVariable to become relative to the current location.
However, on processing, I get a "BAD BACKREFERENCE" error thrown from this line, and I can't seem to get around this. If I insert a space between the "\1" and "#cgi.script_name#", the page processes, but of course I don't want the space in the hyperlink! (could possibly put another REReplace line after this line removing the space, but I'd rather not, and shouldn't have to!)
Finding information on this problem has proved exceedingly difficult, so I'm hoping some of the CF gurus out there may have seen this before. Most likely something painfully obvious staring me in the face, but I can't seem to see it. If ANYONE has any tips / suggestions, they will be warmly welcomed!
Thanks,
K.
I am trying to replace some text in a variable via the use of the REReplaceNoCase function:
<cfset MyVariable = REReplaceNoCase(MyVariable,"(href="")([A-Z0-9])","\1#cgi.script_name#?#Path#\2","ALL")>
This is designed to change the any hyperlinks contained in MyVariable to become relative to the current location.
However, on processing, I get a "BAD BACKREFERENCE" error thrown from this line, and I can't seem to get around this. If I insert a space between the "\1" and "#cgi.script_name#", the page processes, but of course I don't want the space in the hyperlink! (could possibly put another REReplace line after this line removing the space, but I'd rather not, and shouldn't have to!)
Finding information on this problem has proved exceedingly difficult, so I'm hoping some of the CF gurus out there may have seen this before. Most likely something painfully obvious staring me in the face, but I can't seem to see it. If ANYONE has any tips / suggestions, they will be warmly welcomed!
Thanks,
K.