Auteur: ph10 Date: À: Zoltán Herczeg CC: pcre-dev@exim.org, ND Sujet: Re: [pcre-dev] Remove some restrictions of lookbehind assertions
On Tue, 30 Jul 2019, Zoltán Herczeg wrote:
> Thinking about practical use cases. With the proposed changes, doing a submatch is quite overcomplicated:
>
> (*:A)submatch(*:B)(*MOVE:A)(*SETEND:B)match-submatch-again(*MOVE:B)(*SETEND)
>
> Perhaps the other idea, use capturing brackets for this purpose could be better. Something like this:
>
> (submatch)(*match:{1}pattern) is easier.
>
> Inside the {}, a name can be presented as well.
Let me see if I understand that: does (*match:{1}pattern) mean "apply
the pattern to the string that is currently captured by group 1"?
Without looking at the interpreter code, I'm not sure if this is easy or
hard to implement.
> The (*MOVE) could be kept for moving the string pointer around.
(*MOVE) is a small addition and solves ND's non-atomic assertion
requirement. Perhaps we can just start with (*MOVE).