At this point it's mostly a matter of curiousity but an interesting anomaly within either the eval function or the Perl regex engine.It's not. It's just that you're trying to match a backslash, for which you need a double backslash in the regex. But to achieve that, you need to type 4 backslashes in a singlequotish string. It's what's in the string that matters for the regex engine, not what's in your source code.
A backslash only disappears in such a string, if it's in front of a backlslash or a string delimiter (here "'").
In reply to Re: Re: Re: A Regex to identify Regex's / Compiling a regex
by bart
in thread A Regex to identify Regex's / Compiling a regex
by knowmad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |