-
Notifications
You must be signed in to change notification settings - Fork 1
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
Store named capture groups in field table #43
Comments
This would be a breaking change, but logically it makes sense for |
The named capture groups can be extracted from a compiled pattern (
Example pattern and corresponding name table layout:
Obvious approach:
Should look closely at the PCRE2 spec for duplicated group names before doing any optimzations with the number <-> name mapping. |
(source) I.e. Number -> name mapping should be safe if needed; even with |
Numbered groups are already stored; forgot to implement named capture groups.
Also, audit the behavior of
$abc
. Currently,abc
would be treated as an expression (variable). To dereference the field table with a named group, you'd need to use a string literal (e.g.$'abc'
).If the field table were named/aliased (like
arg
), you could cleanly dereference usingmatch.group
ormatch[n]
.The text was updated successfully, but these errors were encountered: