Re: The semantics of the disambiguation constructs

The construct A!B only succeeds if A succeeds and B doesn't. Since [] never succeeds, []!digit would never succeed either. The equivalence works though for ()!digit, or ""!digit, or anything else that matches empty.

Steven

On Tuesday 03 February 2026 13:49:21 (+01:00), Norm Tovey-Walsh wrote:

> > One of the use-cases I have for !A is to express maximal length, such as: 
> >
> > number: digit+, !digit.
> 
> I think that’s the same as:
> 
>   number: digit+, []!digit .
> 
> I think I want “!” to be a separator at least conceptually. But I concede that “!digit” is a nice shortcut for “[]!digit”.
> 
>                                         Be seeing you,
>                                           norm
> 
> --
> Norm Tovey-Walsh
> Saxonica
> 

Received on Tuesday, 3 February 2026 13:43:54 UTC