[thelist] Escaping Parenthesis in RegExp

Keith cache at dowebscentral.com
Sat Mar 9 17:00:01 CST 2002


>At 04:08 PM 3/8/2002 -0800, Robert Goodyear wrote:
>>I'm having some trouble escaping the left and right parenthesis characters
>>when
>>building a Regular Expression.

The \Q & \E escapes all metacharacters, in Perl

$string = "some (stuff) in parenthesis";
/\Q$string\E/


keith
cache at dowebs.com




More information about the thelist mailing list