Prev: Where is -e (file test operator) in man?
Next: FAQ 7.25 Why can't a method included in this same file be found?
From: Peng Yu on 13 Jun 2010 11:39 Suppose I have $string='().', If I want grep such string, I should use regex /\(\)\./. Is there a subroutine to convert '().' to '\(\)\.'?
From: Willem on 13 Jun 2010 11:55 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 13 Jun 2010 12:04
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. |