Backreference in CF rereplace - not sure hoe

I need to replace all punctation in a string with the same character and a space, would like it to do ith only if teh character after teh punct is not a space

#rereplace(SDVR01,"[[:punct:]][^[[:space:]]]","\1 ","all")#
or
#rereplace(SDVR01,"[[:punct:]](?=[^\s])","\1 ","all")#

cant get it to work
LVL 25
James RodgersWeb Applications DeveloperAsked:
Who is Participating?
 
ZvonkoConnect With a Mentor Systems architectCommented:
How about this:
#rereplace(SDVR01,"([[:punct:]])(\S)","\1 \2","all")# 

Open in new window

0
 
James RodgersWeb Applications DeveloperAuthor Commented:
almost, the \S doesnt seem to work but replacing it with [^\s] does, weird...

#rereplace(SDVR01,"([[:punct:]])([^\s])","\1 \2","all")#

a nice to have feature....
any way to get it to do it when the string is 9 char or more?
#rereplace(SDVR01,"?=({9,})[[:punct:]])([^\s])","\1 \2","all")#
didnt work...
0
 
ZvonkoSystems architectCommented:
Check this:
 #rereplace(SDVR01,"(\w{9,}[[:punct:]])([^\s])","\1 \2","all")# 

Open in new window

0
All Courses

From novice to tech pro — start learning today.