For future reference you should avoid using * where possible as it can easily lead to overmatching. Even using + would be better although both + and * alone are greedy matches. An even better solution would be to use a lazy match like so:
\)\s+?\) The ? following the + tells the regex engine to match as little as possible. andy -----Original Message----- From: Rick Colman [mailto:rcol...@cox.net] Sent: Monday, November 22, 2010 9:59 PM To: cf-talk Subject: Re: REGEX hell This worked!! TNX. On 11/22/2010 6:04 PM, Michael Dinowitz wrote: > Are you sure it's a space and not 2 spaces? Or a tab? Try using \s* to > indicate that there may be one or more space characters. > > \)\s*\) > > <cfset cleandata2 = REReplaceNoCase(cleandata1, '\)\s*\)', ')', 'all')> > > On Mon, Nov 22, 2010 at 8:48 PM, Rick Colman<rcol...@cox.net> wrote: > >> I am trying to replace two trailing parens )) with a single paren. >> >> here is a sample string: >> >> (K AAA) (N AAC) (E GAA) ) >> >> looks like there is a space in between the two )), so I tried: >> >> <cfset cleandata2 = #REReplaceNoCase( cleandata1,'\)\ \)',')','all')#> >> >> but this is not working. >> >> Any ideas as two what is wrong greatly appreciated. >> >> >> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339445 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm