I believe this will do it for you - but I haven't had a lot of time to
test it:

<CFSET X = '"column 1","column 2 is ok","column has some "nickname" in
it","ug"'>

<CFSET X = REReplace(X,"([^,])""([^,])","\1\2","ALL")>

<CFOUTPUT>x is now #X#</CFOUTPUT>

=======================================================================
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email    : [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: Tony Schreiber [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, September 12, 2001 10:27 AM
> To: CF-Talk
> Subject: SOT: Regex Help
> 
> 
> I get these text files that I process with CFHTTP (that part 
> works very well for now), but occassionally, the files are 
> messed up, in that they have some quote marks within the text 
> qualified quote marks. Ug.
> 
> Like this:
> 
> "column 1","column 2 is ok","column has some "nickname" in it","ug"
> 
> Which CF chokes on (and rightly so).
> 
> So, I figured I could write a regular expression that 
> replaces any quote mark that doesn't have a comma immediately 
> after it or before it with something else (like a pipe, I 
> don't care)...
> 
> But I'm not that big on figuring out regex's from scratch. 
> Can someone help?
> 
> 
> Tony Schreiber, Senior Partner                  Man and 
> Machine, Limited
> mailto:[EMAIL PROTECTED]                   
> http://www.technocraft.com
> 
http://www.simplemessageboard.com 
___Free Forum Software for Cold Fusion http://www.is300.net
___________The Enthusiast's Home of the Lexus IS300
http://www.digitacamera.com ______________DigitA Camera Scripts and Tips
http://www.linklabexchange.com _____________Miata Link ECU Data Exchange
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to