C
cracraft
Hi,
I am attempting to find out if a $string contains $pattern.
$string =~ /$pattern/i
normally solves it.
However, I noticed that if $pattern contains something like
(4)
and $string contains something like
ABC(4)
then
$string =~ /$pattern/i
does not work, because of the parenthesis.
I want a flat-out literal match where $string can contain any
occurrence of $pattern regardless of parenthesis.
In other words, I don't want the special characters of regular
expressions interpreted.
I could write my own pattern matcher but resist it and would
think Perl could provide the above feature.
Anybody?
--Stuart
I am attempting to find out if a $string contains $pattern.
$string =~ /$pattern/i
normally solves it.
However, I noticed that if $pattern contains something like
(4)
and $string contains something like
ABC(4)
then
$string =~ /$pattern/i
does not work, because of the parenthesis.
I want a flat-out literal match where $string can contain any
occurrence of $pattern regardless of parenthesis.
In other words, I don't want the special characters of regular
expressions interpreted.
I could write my own pattern matcher but resist it and would
think Perl could provide the above feature.
Anybody?
--Stuart