DB<1> $foo = "a\nb\nc\n\nd\ne\n\n\nf\ng\nh\n\ni\n\n\nj\n" DB<2> x $foo =~ /( (:? . | \n (?! \n\n) )+ ) /x 0 'a b c d e' 1 'e'