This should work on all systems (not tested)
REReplace(str,"(#chr(13)#|#chr(10)#|#chr(13)##chr(10)#)\1+","\1","all");
This will not remove them if there is any spaces or tabs after the
returns. If you want all blank lines removed, it should be (again not
tested):
REReplace(str,"(#chr(13)#|#chr(10)#|#chr(13)##chr(10)#)[ #chr(9)#]*(\1[
#chr(9)#]*)*\1","\1","all");
If you are on cfmx you could use :
REReplace(str,"(\r|\n|\r\n)[ \t]*(\1[ \t]*)*\1","\1","all");
Watch out for wrapping:
no spaces in the first regexp,
a space before each #chr(9)# in the second,
a space before each \t in the third.
> -----Original Message-----
> From: Cedric Villat [mailto:[EMAIL PROTECTED]
> Sent: donderdag 27 mei 2004 22:20
> To: CF-Talk
> Subject: Remove multiple carriage returns
>
> I have some text that I need to remove multiple line breaks
> from. For example, if my original text is like this:
>
> > Hello
>
> > My text
>
>
> > goes here
>
>
>
> I want the text to be replaced with
>
> > Hello
> > My text
> > goes here
>
> Basically I want to clean it up so there are no blank lines.
> Is there a simple regex or something else to do this? I'm not
> sure that there will always be a > in the front, I just want
> to remove the blank lines.
>
> Cedric
>
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

