Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: Matching against list of patterns

by tachyon (Chancellor)
on Sep 16, 2004 at 23:00 UTC ( #391589=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Matching against list of patterns
in thread Matching against list of patterns

Remove the map quotemeta and you can use REs to your hears delight. The only issue is then extra | in those REs. My example captures the physical match. It is a simple task to map that back to the pattern (or patterns) that match that if required. The benchmark at Re^2: Matching against list of patterns shows a full order of magnitude speed improvement so the optimiser does OK.

cheers

tachyon


Comment on Re^3: Matching against list of patterns
Re^4: Matching against list of patterns
by Eyck (Priest) on Sep 17, 2004 at 09:50 UTC
    Note that that benchmark is against the code that still does the whole 'foreach' thing, only in different way.

    I'm sorry, but I don't understand how can I accomplish this simple task of mapping 'physical match back to the pattern or patterns that match'.

    This is the task that we're trying to accomplish at first place, so how is it 'simple' if after a bunch of lines of ingenious code we reduce the problem to itself?

    Either I'm missing something, or I described the problem in confusing way?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://391589]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2014-11-28 04:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (193 votes), past polls