- or download this
use warnings;
use strict;
...
@pieces = $str =~ /($BRK+)(.+?(?=$BRK))/gsp;
push @pieces,${^POSTMATCH} if ${^POSTMATCH};
print "WRONG: These were the phrases (and breaks) extracted:\n",join("
+\n",@pieces),"\n";
- or download this
my $BRK = qr(^\s*|\s*<(?:/?(?:p|ul|ol|li)|br\s*/?)>\s*|\s*$)i;
- or download this
my $BRK = qr(\s*<(?:/?(?:p|ul|ol|li)|br\s*/?)>\s*|^\s*|\s*$)i;
- or download this
use warnings;
use strict;
...
my @pieces = $str =~ /($BRK+)(\S.*?(?=$BRK))/gsp;
push @pieces,${^POSTMATCH} if ${^POSTMATCH};
$logfh->print("These were the phrases (and breaks) extracted:\n",join(
+"\n",@pieces),"\n");