A
ajam
Okay, I have the following little problem with regular expressions. I
have two scalar variables $var1 and $var2 as follows:
$var1 = $var2 = "This is a test for C++ and anything else.";
, and I'm trying to compare them as follows:
$var1 =~ /\Q$var2/
Given the fact I have a dot (.) and two plus signs, I need escape the
and '\Q' is supposed to make the content of $var2 literal. Hence, the
plus signs, for example, should just be read as plus signs and not like
'one or more.' Well, at least this is the theory, but it just doesn't
work.
If anyone has any comments on this, I would love to hear it. Thanks
ahead!
-ajam
have two scalar variables $var1 and $var2 as follows:
$var1 = $var2 = "This is a test for C++ and anything else.";
, and I'm trying to compare them as follows:
$var1 =~ /\Q$var2/
Given the fact I have a dot (.) and two plus signs, I need escape the
and '\Q' is supposed to make the content of $var2 literal. Hence, the
plus signs, for example, should just be read as plus signs and not like
'one or more.' Well, at least this is the theory, but it just doesn't
work.
If anyone has any comments on this, I would love to hear it. Thanks
ahead!
-ajam