in reply to Suggestion for regular expression speed improvement.
Corion is right with his suggestions. If you're still interested in how to speed up the regex, here it goes:
The first .+ will first match all characters, then gives up characters until the \t finds the first tab, then the second .+ has no more character to match, then the first .+ has to give up characters again etc.
To avoid all that backtracking, you should substitute each .+ by something that matches everything except tabulators, [^\t]+.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Suggestion for regular expression speed improvement.
by bala.linux (Novice) on Jun 15, 2009 at 12:35 UTC | |
by moritz (Cardinal) on Jun 15, 2009 at 12:37 UTC | |
by bala.linux (Novice) on Jun 15, 2009 at 13:03 UTC | |
by demerphq (Chancellor) on Jun 15, 2009 at 14:25 UTC | |
by moritz (Cardinal) on Jun 15, 2009 at 14:34 UTC | |
by bala.linux (Novice) on Jun 15, 2009 at 14:46 UTC | |
|
In Section
Seekers of Perl Wisdom