How about this?
$string =~ s/^\s*?\n$/\n/mg;
UPDATE: the regex is not working properly but this should, the \n and the $ are somewhat duplicate:
$string =~ s/^\s*?\n/\n/mg;
In reply to Re^3: regex doubt on excluding
by hdb
in thread regex doubt on excluding
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |