Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Slow Regex - How to Optimize

by Anonymous Monk
on Aug 30, 2005 at 22:24 UTC ( #487971=note: print w/ replies, xml ) Need Help??


in reply to Slow Regex - How to Optimize

I'd try a non-greedy quantifier...

if ( $line =~ /[^a-zA-Z]$sub[^a-zA-Z]*?\(/ ) {
...and maybe a more generic subroutine finder...
foreach my $line ( @sub_code ) { if ($line =~ /[^a-zA-Z]([a-zA-Z_]+[a-zA-Z_0-9]*)[^a-zA-Z]*\(/ and exists $SUBS{$1}) { push @subs, $key } }


Comment on Re: Slow Regex - How to Optimize
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (10)
As of 2014-08-01 08:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (257 votes), past polls