d:\>perl -E"for $x (qw/C:\berrybrew\test C:\berrybrew /) {$_=$x; $bs=c +hr(92); s/berrybrew(?!\\+test)/berrybrew${bs}test/; say}" C:\berrybrew\test C:\berrybrew\test d:\>
> Obviously Perl needs to escape the backslash inside a regex
not after interpolation of variables like $bs
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re^4: Windows and backslashes and replacements oh my!
by LanX
in thread Windows and backslashes and replacements oh my!
by stevieb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |