![]() |
|
XP is just a number | |
PerlMonks |
Re: Unexpected Error: \C no longer supported in regex (updated x2)by AnomalousMonk (Archbishop) |
on Aug 20, 2022 at 02:31 UTC ( #11146251=note: print w/replies, xml ) | Need Help?? |
In general, a \ (backslash) introduces a regex zero-width assertion. Some such are \A \B \b \Z \z and there are others. Why do you need backslashes in your paths? Even in Perl running under Windows, forwardslashes work just as well unless you need to construct a command that is to be given to the Windows shell. I don't recall what assertion \C used to be, but clearly Perl does. Update 1: ... in m/C:\Book\ <-- HERE C0001-Chapter-001.mp3/ ...Note that the \B assertion is also present in the m/C:\Book\C0001-Chapter-001.mp3/ regex with which you are trying to construct a match for a file name, so the regex will not match what you think it will even if \C was not a problem. Would a simple string equality eq comparator be better here? (Update: Oops... Forgot you want to do a substitution.) Update 2: See quotemeta:
Give a man a fish: <%-{-{-{-<
In Section
Seekers of Perl Wisdom
|
|