MX7 Developer
www.bennadel.com
Need ColdFusion Help?
www.bennadel.com/ask-ben/
-Original Message-
From: Jon Clausen [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 15, 2007 8:17 PM
To: CF-Talk
Subject: Re: Using reReplace Backreference as StructKey or Argument
Ben,
Thanks
Nadel
Certified Advanced ColdFusion MX7 Developer
www.bennadel.com
Need ColdFusion Help?
www.bennadel.com/ask-ben/
-Original Message-
From: Jon Clausen [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 15, 2007 8:17 PM
To: CF-Talk
Subject: Re: Using reReplace Backreference
reReplace Backreference as StructKey or Argument
Ben,
Agreed, the Len/Pos array loops are ugly and a pain to deal with.
Hence my attempts to bypass all of that by finding a way to pass the
backreference directly in reReplace... :-)
Got around to running timers comparing reFind and your
Clausen [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 14, 2007 8:40 PM
To: CF-Talk
Subject: Using reReplace Backreference as StructKey or Argument
I'm sure it's something simple that I'm missing, but I want to use a
regex backreference as the struct key (i.e. - struct[key]) or as an
argument
Sorry, you can't do that. Here's why:
Coldfusion hands strings off to the regex engine. CF allows you to used
functions, variables, etc. in the string, but it executes them *before*
the regex runs. So, in your first code sample, it's trying to find the
literal key \1 in appSettings, and
Clausen [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 14, 2007 8:40 PM
To: CF-Talk
Subject: Using reReplace Backreference as StructKey or Argument
I'm sure it's something simple that I'm missing, but I want to use a
regex backreference as the struct key (i.e. - struct[key
Ben,
Thanks for the reply. I had sent a response to Ben's reply earlier
today, but I guess it didn't go through.
I figured the order of execution was the issue. I was hoping for a
way to trick the execution order and tried writing the function call
in a bunch of different ways other than
I'm sure it's something simple that I'm missing, but I want to use a
regex backreference as the struct key (i.e. - struct[key]) or as an
argument (i.e. - function(argument) ) but I've failed in all my
attempts so far.
For now I've written the code out using a loop with reFind(),
8 matches
Mail list logo