develooper Front page | perl.beginners | Postings from March 2002

One pattern match? or multiple?

Thread Next
From:
Nikola Janceski
Date:
March 18, 2002 10:22
Subject:
One pattern match? or multiple?
Message ID:
1449413DA482D311B67000508B5A12F50592DEE4@nyexchange01.summithq.com
I know this must be a stupid question but:

let's suppose I am matching for one of multiple matches.
Is it better/faster to split it into several pattern matches or just keep it
one match?

ie: which would be better/faster?

/:\s*$|^\n$|\*|etc/;

/:\s*$/ || /^\n$/ || /\*/ || /etc/


and just for kicks, let's assume we are using this in a grep function for a
giant array.


Nikola Janceski

The most beautiful thing we can experience is the mysterious; It is the
source of all true art and science.
-- Albert Einstein (1879-1955) 


----------------------------------------------------------------------------
--------------------
The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About