s/$newline/$line/;
I think that's the offending line. $newline is parsed as a regex here, but it's an arbitrary string. Use s/\Q$newline\E/$line/ instead. (Or clean up your script.
BTW (\d|\d\d|\d\d\d) can be expressed as (\d{1,3}).
In reply to Re: Regex and Substitute issues
by moritz
in thread Regex and Substitute issues
by Flubb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |