Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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.



  • 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?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2020-11-29 23:22 GMT
Find Nodes?
    Voting Booth?

    No recent polls found