Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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: (14)
As of 2015-07-07 18:03 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 (93 votes), past polls