in reply to Re^4: Return string that starts and ends with specific characters
in thread Return string that starts and ends with specific characters

> but this looks like a fortunate bug, because ^ is a metacharacter in some positions, it's treated differently.

I finally understood that it's not a bug, because ^ is always a metacharacter, in order to match a literal ^ one needs to escape it

And "Match the beginning of the line" will always fail unless modifiers like /m are used

DB<1> p "a^b" =~ /a^b/ DB<2> p "a^b" =~ /a\^b/ 1 DB<3> p "\nb" =~ /^b/m 1

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!