Or the probably faster lookbehind:s/([^\n])\n(?!\n)/$1/g;
s/(?<!\n)\n([^\n])/$1/g;
UPDATE
chipmunk noticed a typo. I had not closed the second
match. Oops.
In reply to Re (tilly) 3: Regex Question
by tilly
in thread Regex Question
by madhatter
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |