Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Matching against list of patterns

by tachyon (Chancellor)
on Sep 16, 2004 at 23:00 UTC ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://391589]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-19 11:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found