my $temp_pos = pos($$input); $$input =~ s/\G\s*(\n)\s*([+-]{2})/$1;$2/sg; pos($$input) = $temp_pos;