> Sorry, I made a mistake with copy&paste. It should
be:
> ReReplaceNoCase(variables.myValues, "(\w*und\w*)", "",
"All")
I figured as much. So, yeah, that's no cop as you're actively
replacing
the bits that you've matched with nothing. You want to
replace the bits
you DON'T want with nothing.
> How can I get it work?
<cfset s1 = "and bum candle dumb errand fumble gander
humble ireland
jumble">
<cfset s2 = REReplace(s1, "(\w*and\w*)?.*?", "\1,",
"ALL")>
<cfset a = listToArray(s2)>
<cfoutput>#s2#</cfoutput>
<cfdump var="#a#">
NB: busy day @ work today, so only had 5min or so to think
about this. It
might not be the best approach. If you look at s2, there's a
bunch of
repeated commas in there, which makes me think there'd be a
better way to
not step over each intermediary character between matches.
Maybe try some finetuning...
--
Adam