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

Exactly. This was my approach but before taking that up I wanted to check with the community whether Im doing anything wrong with regular expression. May be I expected too much from the regular expression. Anyway, thanks for your inputs :)
  • Comment on Re^6: Suggestion for regular expression speed improvement.

Replies are listed 'Best First'.
Re^7: Suggestion for regular expression speed improvement.
by demerphq (Chancellor) on Jun 15, 2009 at 17:10 UTC

    Well no, its just that if you use a big huge complex machine to do the work that you could do with a knife that you arent being efficient.

    And split does use the regex engine, its just it uses it in special ways to be efficient.

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

      Yes. My initial idea was to keep CSV, RE parsing separate but I thought may be If could get the same performance from RE, then need not to have a CSV parser. But now I understand that is not possible to think of. So, need to switch back to my old approach where I do two parsing separately. So, from the user interface user will have simple/advanced parsing modes. Thanks for your suggestion.

        Dont forget unpack. For fixed width fields its pretty much the fastest choice you have. And many logfiles are fixed width.

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