
On 13-04-2004 at 17:47, Alessandro Ranellucci wrote:
$Self->{Body} =~ s/(> )?(.{$NewLine}[^\s]*\s)/$2\n/g;
Actually that line should be as follow to prevent un-quoting of quoted
text:
$Self->{Body} =~ s/((> )?.{$NewLine}[^\s]*\s)/$1\n/g;
--
Alessandro Ranellucci (HOSTING CENTER)

Hi Alessandro, On Tue, Apr 13, 2004 at 06:33:21PM +0200, Alessandro Ranellucci wrote:
On 13-04-2004 at 17:47, Alessandro Ranellucci wrote:
$Self->{Body} =~ s/(> )?(.{$NewLine}[^\s]*\s)/$2\n/g;
Actually that line should be as follow to prevent un-quoting of quoted text:
$Self->{Body} =~ s/((> )?.{$NewLine}[^\s]*\s)/$1\n/g;
How about lines with more the $NewLine chars? Do you know an regexp to insert an \n bevor $NewLine is reached? For example: "His is a long line with a lot of words an here is a loooooooooonnnnnggggg word." $NewLine is there: -----------------------------------^ But I want to insert the \n bevor "loooooooooonnnnnggggg". Do you have an solution? Thanks!
-- Alessandro Ranellucci (HOSTING CENTER)
Ph. +39 06 6788489 - Fax +39 06 23315902 - http://www.hostingcenter.it
Martin Edenhofer -- ((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg http://www.otrs.de/ :: Manage your communication!

On 15-04-2004 at 18:19, Martin Edenhofer wrote:
How about lines with more the $NewLine chars? Do you know an regexp to insert an \n bevor $NewLine is reached?
I think that there's no single regexp to do that; a loop should be used, or (better!) the Text::Wrap module. It is a standard module, so there is no blocking dependency with adding it: http://www.perldoc.com/perl5.8.0/lib/Text/Wrap.html This would do the job for us: use Text::Wrap; (...) $Text::Wrap::columns = $NewLine; $Text::Wrap::huge = 'overflow' #This prevents us from breaking URLs $Self->{Body} = wrap( '', '', $Self->Body ); Why not checking this code in right now? ;-)))) --Alessandro.
participants (2)
-
Alessandro Ranellucci
-
Martin Edenhofer