Closed Alexey-T closed 1 year ago
Proposal how to implement \K for all choices for all groups (nested too)
Add class field regParseK
Add opcode OP_K which will store current pos (regParse?) to regParseK
MatchPrim calls itself. On enter, it clears regParseK, on found result it maybe has set regParseK (if op_k was present). Outer MatchPrim checks if regParseK is set- if yes, it adjusts result of called MatchPrim, clears regParseK (must clear to not affect outer matchprim calls).
https://regular-expressions.mobi/keep.html?wlr=1