Help for this page

Select Code to Download


  1. 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";
    
  2. or download this
    my $BRK = qr(^\s*|\s*<(?:/?(?:p|ul|ol|li)|br\s*/?)>\s*|\s*$)i;
    
  3. or download this
    my $BRK = qr(\s*<(?:/?(?:p|ul|ol|li)|br\s*/?)>\s*|^\s*|\s*$)i;
    
  4. 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");