Looking for a useful regex? How about one that reflows text that’s been cut & pasted from a text email and consequently chopped at 72 chars/line?
print preg_replace("/\n(?!\n)/", "", $foo);
where $foo is your text. Not perfect yet but contributions welcome. Thanks to Andrew, who’s known as Mr. Walking Regular Expression around the office, for his help. Given a text pattern problem of arbitrary complexity, Andrew blinks twice then speaks the regex in reply.