Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

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 } }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://487971]
[Corion]: Mhrrrr. Some project made changes to a report I ingest. I tell them "the format of the new rows is bad". They change it, without understanding/ knowing what other systems might act on this suffix. While it now works for me, I'm not really happy with ...
[Corion]: ... their approach to changing things and waiting who screams at them.

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (11)
As of 2017-07-24 14:02 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (354 votes). Check out past polls.