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