splitting into paras

Matthew Lawrence matthew.lawrence at ehsbrann.com
Wed Jan 11 11:40:21 GMT 2006


Simon Wistow wrote:
> For what it's worht this no seems to liberally accept all manner of crap 
> input
> 
> my $crlf = qr/\x0a\x0d|\x0d\x0a|\x0a|\x0d/;
> my @paras = split /(?:$crlf\s*)/, $text;
> 
> 

Won't that produce 6 paragraphs for your original example instead of the
3 you were after?

@paras = split /(?:$crlf\s*){2,}/, $test;

Matt


More information about the london.pm mailing list