help with REReplace
This is a multi-part message in MIME format. --=_NextPart_000_000D_01C00609.01E91A20 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all, I need to check for single instances of a CR/LF only and replace them = with null strings. Am I right with this bit of code? When I run the application, the server seems to hang. Is this expected = behaviour? Thanks, Jamie -- 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 --=_NextPart_000_000D_01C00609.01E91A20 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all, I need to check for single instances of a CR/LF only = and=20 replace them with null strings. Am I right with this bit of=20 code?When I run the application, the server seems to = hang. Is=20 this expected behaviour? Thanks, Jamie --Jamie = KeaneProgrammerSolutionMasters,=20 Inc.9111 Monroe Rd., Suite 100Charlotte, NC 28270http://www.solutionmasters.com">www.solutionmasters.com70= 4.563.5559=20 x 228 Voice704.849.9291 Fax --=_NextPart_000_000D_01C00609.01E91A20-- -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ 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.
Re: help with REReplace
Do you mean if you have adjacent cr/lf (say 3) you want to keep 3 but if you have 1 you want to strip it? If so I don't think what you have will work because it will not distinguish adjacent occurences. Also since you have the ? you will be replacing nothing or \r with nothing which will probably hang the server. - Original Message - From: "Jamie Keane" <[EMAIL PROTECTED]> To: "CFTalk" <[EMAIL PROTECTED]> Sent: Monday, August 14, 2000 2:02 PM Subject: help with REReplace > This is a multi-part message in MIME format. > > --=_NextPart_000_000D_01C00609.01E91A20 > Content-Type: text/plain; > charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > > Hi all, > > I need to check for single instances of a CR/LF only and replace them = > with null strings. Am I right with this bit of code? > > > > When I run the application, the server seems to hang. Is this expected = > behaviour? > > Thanks, > Jamie > > -- > 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 > > --=_NextPart_000_000D_01C00609.01E91A20 > Content-Type: text/html; > charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > > > > http-equiv=3DContent-Type> > > > Hi all, > > I need to check for single instances of a CR/LF only = > and=20 > replace them with null strings. Am I right with this bit of=20 > code? > > <cfset var =3D=20 > REReplace(inputvar,"\r?","","ALL")> > > When I run the application, the server seems to = > hang. Is=20 > this expected behaviour? > > Thanks, > Jamie > --Jamie = > KeaneProgrammerSolutionMasters,=20 > Inc.9111 Monroe Rd., Suite 100Charlotte, NC 28270 href=3D"http://www.solutionmasters.com">www.solutionmasters.com70= > 4.563.5559=20 > x 228 Voice704.849.9291 Fax > > --=_NextPart_000_000D_01C00609.01E91A20-- > > -- > Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ > 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/cf-talk@houseoffusion.com/ 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.
RE: help with REReplace
> 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: However, this will only handle input from browsers that (correctly) wrap lines with both Cr and Lf. To handle both: -Rick -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ 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.
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 >> > >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: > > > >However, this will only handle input from browsers that (correctly) wrap >lines with both Cr and Lf. To handle both: > > > >-Rick > >--- --- >Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ >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/cf-talk@houseoffusion.com/ 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.
RE: help with REReplace
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 I cannont remember right now if \r is correct, if \r does work as a newline value in RE's, then: 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 >> > >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: > > > >However, this will only handle input from browsers that (correctly) wrap >lines with both Cr and Lf. To handle both: > > > >-Rick > >--- --- >Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ >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/cf-talk@houseoffusion.com/ 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/cf-talk@houseoffusion.com/ 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.