- or download this
my $re_single = qr/
(?:\A|[\r\n]) # either the start of text or newline
...
(?:\z|(?:\r\n|\n\r|\r|\n)\z) # last nl or eof
)
/xs;
- or download this
my $re_single = qr/
^ ( .* \n? \z )
...
/mx;
$String =~ s/\r\n|\n\r|\r|\n/\n/g;
- or download this
my $re_single = qr/
(?:\A|[\r\n]) # either the start of text or newline
...
return( "" );
}
}
- or download this
sub Last_N_Lines {
my ( $str, $n ) = @_;
...
}
$String =~ s/\r\n|\n\r|\r|\n/\n/g;