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

Backreferences to capture groups in regex() #12

Open
Xion opened this issue Jun 25, 2012 · 0 comments
Open

Backreferences to capture groups in regex() #12

Xion opened this issue Jun 25, 2012 · 0 comments
Milestone

Comments

@Xion
Copy link
Owner

Xion commented Jun 25, 2012

Currently, the regex generator offers only limited support for capture groups: it just ignores them :) To enhance this, the syntactic elements \1, \2, and so on, need to be interpreted correctly as commands to copy-paste the strings that we generated previously for the corresponding capture groups.

Such an enhancement requires a bit of refactoring to the whole regex-reversal code. It should be best to decouple it from the regex generator itself, because it will need to carry more state than can be stored directly on the call stack of various __reverse_X_node methods: namely, the strings we have generated for earlier capture groups.

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

No branches or pull requests

1 participant