On 2018-07-10 11:31, ph10 wrote:
Perl 5.026002 Regular Expressions
/(?!(a)b)/
a
0: 1: a
/(?!(a)b|ac)/
a
0:/(?!ac|(a)b)/
a
0: It seems to save the capture only if there is just one branch in the
assertion. Or maybe it has some algorithm for deciding on which branchto
try first ... I don't
On Tue, 10 Jul 2018, ND via Pcre-dev wrote:
> I guess Perl doesn't backtrack if last alternative of negative assertion
> fails.
Not quite (see below). I suspect it is just the way the Perl code turned
out rather than a deliberate design. I couldn't find any Perl
documentation about this.
>
On 2018-07-10 04:48, ND wrote:
On 2018-07-09 09:25, ph10 wrote:
>If any branch in a negative assertion succeeds, the captures are>
(temporarily) kept, but as the whole assertion now fails, there is an>
external backtrack, which discards the captures.
>
To what point backtracking is?
I guess
On 2018-07-09 09:25, ph10 wrote:
If any branch in a negative assertion succeeds, the captures are
(temporarily) kept, but as the whole assertion now fails, there is an
external backtrack, which discards the captures.
To what point backtracking is?
I guess Perl doesn't backtrack if last
On Sun, 8 Jul 2018, ND via Pcre-dev wrote:
> May I suggest alternative approach? It is simple and more consistent. I think
> Perl use it:
>
> Capture is discarded ONLY if it was happen in non-matching branch.
Actually, this is *exactly* what should already happen! I was going to
post an
On 2018-07-07 16:50, ph10 wrote:
I decided that the most straightforward approach
was to discard all capturing inside negative assertions when the
assertion completes.
May I suggest alternative approach? It is simple and more consistent. I
think Perl use it:
Capture is discarded ONLY if
On Fri, 6 Jul 2018, ND via Pcre-dev wrote:
> PCRE documents:
> "No capturing is done for a negative assertion unless it is being used as a
> condition in a conditional subpattern (see the discussion below). Matching
> continues after a non-conditional negative assertion only if all its branches
>
Good day.
PCRE documents:
"No capturing is done for a negative assertion unless it is being used as
a condition in a conditional subpattern (see the discussion below).
Matching continues after a non-conditional negative assertion only if all
its branches fail to match."
But capture