$str =~ s/(?<!\\)\\$/\\\\/; # match a backslash at the EOL # that isn't preceded by a backslash
See perlre for more stuff like this.
In reply to Re^3: Regex to dereference
by gaal
in thread Regex to dereference
by Hena
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |