Tally List : mailing list management, archiving, and analysis
click for archive home
 
Archive of:
CF-Talk
Cold Fusion - Technical
 
home
24 hour view
quick stats
weekly updates
 
all tallylists
corporate solutions
archive your favorite
help / feedback


Search the Tallylist search by keyword:

About Cold Fusion :
product's home
product's list home
 
  Archived TallyList / CF-Talk: 
Subject: RE: [Any RegEx wizards about??]
Jeremy Allen (47p/+1r)     Posted: Tuesday 27 Feb 2001
This post: 93 views, +0 rating

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 >


Similar Subject Line Posts (+/- two weeks of this post)
RE: SurePay  12 Mar 2001   (43 v/ +0 r)
RE: Project Mgmt for CF development?  12 Mar 2001   (41 v/ +0 r)
Re: Project Mgmt for CF development?  12 Mar 2001   (37 v/ +0 r)
Re: Can CF work with a FileMakerPro database?  12 Mar 2001   (48 v/ +0 r)
RE: Help with a <cfscript>  12 Mar 2001   (39 v/ +0 r)
Re: Can CF work with a FileMakerPro database?  12 Mar 2001   (42 v/ +0 r)
RE: Session variables  12 Mar 2001   (46 v/ +0 r)
Help with a <cfscript>  12 Mar 2001   (49 v/ +0 r)
RE: search a text file  12 Mar 2001   (42 v/ +0 r)
RE: Session variables  12 Mar 2001   (40 v/ +0 r)
RE: CF as User  12 Mar 2001   (37 v/ +0 r)
RE: CF as User  12 Mar 2001   (39 v/ +0 r)
RE: CF as User  12 Mar 2001   (37 v/ +0 r)
CF as User  12 Mar 2001   (42 v/ +0 r)
OT/Summary: DB Server Upgrade Dilemma  12 Mar 2001   (41 v/ +0 r)
RE: Number to String?  12 Mar 2001   (46 v/ +0 r)
RE: Client variables  12 Mar 2001   (49 v/ +0 r)
RE: Looking for Job  12 Mar 2001   (44 v/ +0 r)
Client variables  12 Mar 2001   (48 v/ +0 r)
RE: Session variables  12 Mar 2001   (41 v/ +0 r)
RE: Number to String?  12 Mar 2001   (35 v/ +0 r)
RE: W2k cannot see webserver?  12 Mar 2001   (34 v/ +0 r)
Session variables  12 Mar 2001   (46 v/ +0 r)
RE: W2k cannot see webserver?  12 Mar 2001   (38 v/ +0 r)
RE: Any recommendations on an E-commerce software?  12 Mar 2001   (46 v/ +0 r)
 

Send a reply to the CF-Talk list!
click to send a reply! NOTE: Many lists will reject your post unless you have already registered with them. Also - don't forget the right account to send from (for those with multiple emails!)

Feedback: If this post was exceptionally helpful, please help by giving this post a positive review.

 

TallyList : copyright Ububik - 2000