Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reminder for me: \K #203

Closed
Alexey-T opened this issue Aug 30, 2020 · 1 comment
Closed

Reminder for me: \K #203

Alexey-T opened this issue Aug 30, 2020 · 1 comment

Comments

@Alexey-T
Copy link
Collaborator

Alexey-T commented Aug 30, 2020

k

https://regular-expressions.mobi/keep.html?wlr=1

@Alexey-T
Copy link
Collaborator Author

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant