in reply to Re: In search of an efficient query abstractor
in thread In search of an efficient query abstractor
As I understand it, that would still do backtracking, right? Try to match the first one; if it fails, backtrack and try to match the alternative.
Another challenge here is that the initial characters are optional. Maybe if I write things out fully it becomes easier to optimize. I'll meditate on that. In that case, it might look like
my $number = qr{ \b\d+ | \b\d+\.\d+\ | \b\.\d+ .... }x;
But it already looks like I'm introducing backtracking again. My gut feeling is that I can write a state machine for this that doesn't need to do backtracking. Hmmm :-\
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: In search of an efficient query abstractor
by Corion (Patriarch) on Dec 07, 2008 at 15:48 UTC | |
Re^3: In search of an efficient query abstractor
by gone2015 (Deacon) on Dec 07, 2008 at 20:44 UTC | |
by xaprb (Scribe) on Dec 07, 2008 at 21:07 UTC |
In Section
Seekers of Perl Wisdom