in reply to Re: Re: Matching brackets in Regular Expression
in thread Matching brackets in Regular Expression
Except that the parens () will be used for grouping and capturing by the regex, and so won't match the literals in the string;
perl -e '$s = q|b(s)|; print "without quotemeta" if $s =~ /$s/; print + "with quotemeta" if $s =~ /\Q$s\E/;' with quotemeta
|
---|