How about this:

text = REreplace(text, "[#chr(10)##chr(13)#]+", chr(10), "all");

That'll return newline separated lines, which will mostly work, though you
may want to do some detection to pick the right line ending first (from the
actual text), and use that instead.

start = REfind("[#chr(10)##chr(13)#]", text);
end = Refind("[^#chr(10)##chr(13)#]", text, start);
lineseparator = mid(text, start, end - start);
text = REreplace(text, "[#chr(10)##chr(13)#]+", lineseparator, "all");

That's all totally untested, but it should be close.

Cheers,
barneyb

> -----Original Message-----
> From: Cedric Villat [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 27, 2004 1:20 PM
> 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]

Reply via email to