regex
- From: jag.robin18@xxxxxxxxxx (Gerard Robin)
- Date: Wed, 16 Nov 2005 10:42:41 +0100
Hello,
in a script I can write:
if (
.....
$subject =~ /phar/i or
$subject =~ /phfar/i or
$subject =~ /phhar/i or
$subject =~ /phya/i or
$subject =~ /photo/i
.....
){..}
"or"
if (
.....
$subject =~ /ph(ar|far|har|ya|oto)/i
.....
){...}
"or"
if (
.....
$subject =~ qr(ph(ar|far|har|ya|oto))i
.....
){...}
I wonder which one of these forms is faster ?
About qr :
if I do :
$match = qr(ph(ar|far|har|ya|oto));
print ref $match, $/;
I get the output:
Regexp
What is $match exactly ?
Why I can bless $match ?
tia (I know perldoc perlop ...)
--
Gérard
.
- Follow-Ups:
- Re: regex
- From: John W. Krahn
- Re: regex
- Prev by Date: RE: Hi All
- Next by Date: Check empty hash
- Previous by thread: how to read write COM port
- Next by thread: Re: regex
- Index(es):
Relevant Pages
|