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

Re: regex alternation

by AlexTape (Monk)
on Sep 30, 2011 at 10:32 UTC ( #928739=note: print w/ replies, xml ) Need Help??


in reply to regex alternation

at first it will be a bit faster if you dont use an alias for $_. perhaps try map to increase the speed.. im intrested too in this case.. probably there is a solution via hashing.. u need exactly match||no match prints? or you "only" need the matched lines? <= if so it can be done faster 4 sure..

for(@test_array){print "MATCHED\n" if $_ =~ $test3 && next; print "NO MATCH\n";} #untested
futhermore check:
How do I optimize a regular expression? and
Perl regexp matching is slow??

$perlig =~ s/pec/cep/g if 'errors expected';


Comment on Re: regex alternation
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2015-07-02 01:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (25 votes), past polls