Here is some sample code.. You must escape all quotes since they are a CF string.
So the first REReplace replaces everything between two quote marks.
So: This is some string "In quotes" :)
Becomes: This is some string "My New Quote!!" :)
The second regular expression will yield: This is some string **In quotes** :)
You did everything right except you are dealing with a ColdFusion string and to escape a double quote in a coldfusion string you must put two of them.
A backslash will not really work sinec that will give you an error.
Jeremy Allen elliptIQ Inc.
<!--- Code snippet ---> <CFSET strFoo = "This is some string ""In quotes"" :)"> <CFOUTPUT>#strFoo#<BR></CFOUTPUT>
<CFSET strFoo = REReplace(strFoo, """[^""]*""", """My New Quote!!""")> <CFOUTPUT>#strFoo#<BR></CFOUTPUT>
<CFSET strFoo = "This is some string ""In quotes"" :)">
<CFSET strFoo = REReplace(strFoo, """", "**", "ALL")> <CFOUTPUT>#strFoo#<BR></CFOUTPUT>
>-----Original Message----- >From: Alex [mailto:double-down@usa.net] >Sent: Tuesday, February 27, 2001 9:43 AM >To: CF-Talk >Subject: Re: [Any RegEx wizards about??] > > >try >#REReplace("#Form.EmailText#","[\"]","","ALL")# > >"Edward Chanter" <edward@cc.uk.com> wrote: >HELP! > >I hate these things...... > >Why won't: > >#REReplace("#Form.EmailText#","["]","","ALL")# > >work, when > >#REReplace("#Form.EmailText#","[(]","","ALL")# > >does work.... I bet it's the speechmarks I'm trying to replace with >blanks..... what should I use instead of a speechmark???? > >:-( > >Any help would be greatly appreciated.... > > -= Ed >