[pcre-dev] Bactracking controls in subroutines

Top Page
Delete this message
Author: ND
Date:  
To: Pcre-dev
Subject: [pcre-dev] Bactracking controls in subroutines
Good day.


Look to pcretest listing:

PCRE2 version 10.31 2018-02-12
/(?1)(*F)|(a(*COMMIT))/
a
0: a
1: a


In Perl this pattern not matched.

There are differences in how PCRE and Perl act with control verbs in
subroutines.
This is documented in PCRE:
"Perl's treatment of subroutines is different in some cases.
...
(*COMMIT), (*SKIP), and (*PRUNE) in a subpattern called as a subroutine
cause the subroutine match to fail."

Some time ago PCRE change the subroutines calls conception and process it
in Perl manner (not as atomic). Now backtracking can cross subroutine
border.
But it seems that backtracking control COMMIT not have been adopted and
not expand its power cross subroutine borders.

May be the same situation is with all backtracking controls, I don't test
others.

Is there weighty reason to stay backtracking controls not
"cross-subroutine" when backtracking is cross-subroutine? And stay
incompatible with Perl?


Thanks.