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

One pattern match? or multiple?

Thread Next
Nikola Janceski
March 18, 2002 10:22
One pattern match? or multiple?
Message ID:
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/

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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About