Are all 'special variables' ($&, $N (N is integer)) expanded in that way too?All variables are expanded that way, special or not:
See also quotemeta and the \Q and \E escape sequences.my $var = '[ab]'; my $string = '12a3434'; print "match" if $string =~ /$var/;
In reply to Re^3: Regex error when [] occurs in file..
by Joost
in thread Regex error when [] occurs in file..
by why_bird
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |