tomazos has asked for the wisdom of the Perl Monks concerning the following question:
I have a scalar string..
my $foo = '$@!#@#$^$#@^';
..and I want to incorporate it into a regular expression such that the characters of the string will be matched literally, no matter what characters they are.
ie
my $bigfoo='aabbaaa$@!#@#$^$#@^bbabaaba'; assert $bigfoo =~ /(a|b)*$foo(a|b)*/;
What is the correct way to interpolate a string literal into a regular expression?
Thanks,
-Andrew.
Back to
Seekers of Perl Wisdom