Well, the idea behind your regex way would have done the exact same thing.
The solution you want is more along the lines of this

<CFSET crlf = Chr(13) & Chr(10)>
<CFSET var = REReplace(inputvar, "([^#crlf#])#crlf#([^#crlf#])", "\1\2",
"ALL")>

I cannont remember right now if \r is correct, if \r does work as a newline
value in RE's, then:

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

I do not have time to look up the \r thing, but this should find and squash
single newlines.

Justin Kidman

-----Original Message-----
From: Jamie Keane [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 14, 2000 1:45 PM
To: [EMAIL PROTECTED]
Subject: Re: help with REReplace


The problem I see with the non-regex solutions is that they will replace all
CR/LFs, whereas I only want to replace single single instances, while
leaving double instances untouched.

--
Jamie Keane
Programmer
SolutionMasters, Inc.
9111 Monroe Rd., Suite 100
Charlotte, NC  28270
www.solutionmasters.com
704.563.5559 x 228  Voice
704.849.9291  Fax
-----Original Message-----
From: Rick Osborne <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Monday, August 14, 2000 4:23 PM
Subject: RE: help with REReplace


>> <cfset var = REReplace(inputvar,"\r?","","ALL")>
>
>This will replace all characters with an empty string, one character at a
>time.  Somehow, I imagine that this is not what you want.  :)
>
>You really don't even need a regex for this; it's just a simple search and
>replace:
>
><CFSET var=Replace(inputvar,Chr(13) & Chr(10),"","ALL")>
>
>However, this will only handle input from browsers that (correctly) wrap
>lines with both Cr and Lf.  To handle both:
>
><CFSET var=ReplaceList(inputvar,"#Chr(13)#,#Chr(10)#",",","ALL")>
>
>-Rick
>
>---------------------------------------------------------------------------
---
>Archives: http://www.mail-archive.com/[email protected]/
>To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to