Exactly what I was looking for. Thank you. Now, just a question of usage- are
quotemeta() and \Q\E exchangeable? Also, if I use \Q, is it important to close it with
a \E, or if the entire string needs to be quoted, can I just leave it open (as you
did)? Thanks again.
On 7/12/01 Ronald J Kimball wrote:
> >
>> > The result of this is "no match" since the parentheses are being
>> > evaluated somehow. If I remove one of the parentheses in one of the
>> > strings, I get an error "unmatched () in regexp". If I remove all of
>> > the parentheses from both strings, I get "match". Is there a way that
>> > I can get grep to consider everything in the strings, including the
>> > parentheses, as simple characters? If I can't, do I need to clean
>> > every string before the match, removing parentheses and any other
> > > offending characters? Thanks in advance.
>
>
>Use quotemeta() or \Q\E instead:
>
>if ($db_string =~ /\Q$web_string/) {
> print "Match!\n";
>}
>
>Ronald