Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Suggestion for regular expression speed improvement.

by bala.linux (Novice)
on Jun 15, 2009 at 12:35 UTC ( [id://771638]=note: print w/replies, xml ) Need Help??


in reply to Re: Suggestion for regular expression speed improvement.
in thread Suggestion for regular expression speed improvement.

This sounds good. I will adopt this change and compare the performance. Thanks.
  • Comment on Re^2: Suggestion for regular expression speed improvement.

Replies are listed 'Best First'.
Re^3: Suggestion for regular expression speed improvement.
by moritz (Cardinal) on Jun 15, 2009 at 12:37 UTC
    No, don't. Go with the tips Corion gave you above, it's much more sensible to use split or a module - my explanation was mostly to satisfy academic curiosity, and not meant as a suggestion on how to solve your problem.
      As I mentioned above, I would not be able to take that approach. Since, I want to enable support to match log lines of any format with grouping. If I go by CSV, then I would not be able to parse other formatted logs like syslogs and other proprietary logs.

        You need to think out of the box. Make your system handle the various cases. A regex, a split, an unpack, maybe even an xml parser....

        Definitely doing it the way you are is wrong. If you are really insistent on ignoring our advice (unwise really), then at least use inversion and you might want to investigate the (?>...) construct "atomic matching". As well as adding anchors to your pattern.

        ---
        $world=~s/war/peace/g

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-20 16:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found