in reply to Re: Do nothing? or Do something important in a very obscure way?
in thread Do nothing? or Do something important in a very obscure way?

Makes sense in terms of Perl5 regex's, but in the original context of Exegesis5 where the 'x??' and 'x*?' are followed by the Perl6 'don't backtrack' ':' operator, I am not so sure?


What's this about a "crooked mitre"? I'm good at woodwork!
  • Comment on Re: Re: Do nothing? or Do something important in a very obscure way?

Replies are listed 'Best First'.
Re3: Do nothing? or Do something important in a very obscure way?
by blakem (Monsignor) on Aug 23, 2002 at 11:16 UTC
    Ah, I see now.... /x??:/ will behave exactly like /x{0}/
    In english /x??:/ would read something like this:

    Match 'x' zero or one times, prefer 0 over 1, lock in the first value that allows this atom to match (i.e. don't backtrack).

    Since the 0 will always cause the atom to match, the engine will never be allowed to try the 1.

    I know thats not the best description.... hope it helps.

    -Blake