You need to 'remember' the character grabbed by the dot in a backreference:
rereplace(string, (.)/(.), \1 / \2, all);
That should take care of you.If you have any more questions, we might
want to move to CF-Regex (available via the HoF archives if you don't
want to subscribe).
--Ben Doom
Hi all,
Here is a quick one for you.
I have a Variable that I am trying to do a rereplace on and it isn't working
as I expected.
Here is the code:
cfset Variables.myNewVar = rereplace(Variables.myOldVar,./., . / .,
All)
I was hoping that it would convert: DOGS/CATS
TO: DOGS / CATS
but
You need to grab the S from DOGS and the C from Cats that you are replacing.
For example:
cfset Variables.myNewVar = rereplace(Variables.myOldVar,(.)/(.), .\1/\2.,All)
the () around the dots grabs those values.
The \1 and \2 put them back in.
Does that make sense?
Jerry Johnson
[EMAIL
3 matches
Mail list logo