On Mon, 15 May 2006 [EMAIL PROTECTED] wrote:

> David B Funk wrote:
> > Thus my suggested alternative to give it something to chew on
> > ('[^>]{0,50}') rather than the '.{0,50}' to provide an explicit
> > termination criteria.
>
> The termination criterion is the ">" at the beginning of the next iteration.
>
> .{0,50}?> and [^>]{0,50}> are functionally equivalent.

Is that true in light of the non-backtracking qualifier at the
beginning of the whole grouping?

Specifically, with "[^>]{0,50}>" a match can be found deterministically
without having to backtrack (IE in one pass thru the text string you can
say with certanty, "yes it does match" or "no match possbile".

Is the perl engine 'smart enough' to do that with ".{0,50}?>", given
that backtracking was explicitly disallowed?

For example suppose the target string was "DIV>"

the ".{0,50}" would match on the null string, then you'd look to see
if the next character was '>'. Oops, it's not, so back up and try
"eating" one '.' then check for that '>' again. (however backing
up isn't allowed, so the whole thing should fail).

So either that non-backtracking qualifier is the fly in the whole
ointment or I'm misunderstanding what it means.

-- 
Dave Funk                                  University of Iowa
<dbfunk (at) engineering.uiowa.edu>        College of Engineering
319/335-5751   FAX: 319/384-0549           1256 Seamans Center
Sys_admin/Postmaster/cell_admin            Iowa City, IA 52242-1527
#include <std_disclaimer.h>
Better is not better, 'standard' is better. B{

Reply via email to