From: Peng Yu on
Suppose I have $string='().',

If I want grep such string, I should use regex /\(\)\./. Is there a
subroutine to convert '().' to '\(\)\.'?
From: Willem on
Peng Yu wrote:
) Suppose I have $string='().',
)
) If I want grep such string, I should use regex /\(\)\./. Is there a
) subroutine to convert '().' to '\(\)\.'?

You should read the docs for regular expressions.
Especially the bit about the \Q operator.
I'm sure it will be most helpful.


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
From: Tad McClellan on
Peng Yu <pengyu.ut(a)gmail.com> wrote:
> Suppose I have $string='().',
>
> If I want grep such string, I should use regex /\(\)\./. Is there a
> subroutine to convert '().' to '\(\)\.'?


Please refrain from asking us to read the docs to you, it
is getting tiresome...

perldoc perlreref

Has a section named "FUNCTIONS".

That would probably be a good place to look for functions
having to do with regular expressions.


perldoc -f quotemeta


--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.