exrex
exrex copied to clipboard
Support for optional backref
This works:
$ exrex "(?P<var>[a]) (?P=var)"
a a
but when marking backref as optional, it throws error.
$ exrex "(?P<var>[a])? (?P=var)"
File "exrex.py", line 537, in __main__
args['output'].write(next(g))
File "exrex.py", line 92, in dappend
yield cc + d[k]
KeyError: 1
So when first group is empty, the 2nd as well.