exrex icon indicating copy to clipboard operation
exrex copied to clipboard

Support for optional backref

Open kenorb opened this issue 11 months ago • 0 comments

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.

kenorb avatar Feb 09 '25 14:02 kenorb