Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Matching lines in 2+ GB logfiles.

by mscharrer (Hermit)
on May 01, 2008 at 18:16 UTC ( #683983=note: print w/replies, xml ) Need Help??


in reply to Re^2: Matching lines in 2+ GB logfiles.
in thread Matching lines in 2+ GB logfiles.

Perl is more flexible and powerful than grep but definitive not faster. Also AFIK grep (or was it egrep?) uses a finite state machine, not a infinite one like perl, so it is much faster, but much less flexible, i.e. doesn't support back-tracking, etc..

Try to optimise your regex to speed things up. In perl you can use use re 'debug'; to show how many permutations you regex causes.

Replies are listed 'Best First'.
Re^4: Matching lines in 2+ GB logfiles.
by samtregar (Abbot) on May 01, 2008 at 18:24 UTC
    Perl's regular expression engine may be powerful but it doesn't yet use an "infinite" state machine! I think the terms you're looking for are NFA (Nondeterministic Finite Automaton, like Perl) and DFA (Deterministic Finite Automaton, like egrep, sometimes, it's actually a hybrid).

    -sam

      Yes, you are right, that was exactly what I meant. I confused some terms here. Thanks for pointing this out.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2022-01-22 21:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (63 votes). Check out past polls.

    Notices?