in reply to How to split into paragraphs?

Here's what I came up with. This shouldn't fail even if the asdf lines contain colons.

oops, noticed i'd miss abc: lines if there were no asdf lines.

^((\w+):\n((?:[^\n]+\n)+)) -> ^((\w+):\n((?:[^\n]+\n)+)*)
while ( $data =~ /^((\w+):\n((?:[^\n]+\n)+)*)/gm ) { my ( $key, $val ) = ( $2, $3 ); chomp $val; ## remove pesky \n\n doSomething( $key, $val ); ## store it, print it, ignore it.. }
JJ