regular expression matching

Curtis Poe cp at
Wed Jun 5 16:23:15 CDT 2002


if( $service =~ /\Q$rule\E/ ){
    print "$rule is in $service \n";
} else {
    print "$rule isn't in $service \n";

\Q and \E help to ensure that the text is interpreted literally (i.e.,
characters with special meaning to a regex are treated literally.  Read
'perldoc perlre' for more information about pitfalls using \Q and \E.

Curtis Poe
Senior Programmer
ONSITE! Technology, Inc.

Taking e-Business and Internet Technology To The Extreme!
----- Original Message -----
From: Jason White
To: pdx-pm-list at
Sent: Wednesday, June 05, 2002 1:56 PM
Subject: regular expression matching

I usually only use regular expressions for substitutions s///g etc.

How exactly do I use a regular expression as a boolean value?
for example:

Jason White


More information about the Pdx-pm-list mailing list