exrex icon indicating copy to clipboard operation
exrex copied to clipboard

backreference issue

Open zdilto opened this issue 5 years ago • 0 comments

first backreference \1 will not be matched if there is more than one ( ) and followed by ? or {0,1} like in below example:

exrex.py "(19[0-9][0-9]|20[0-9][0-9]|[0-9][0-9]){0,1}@?(alae|yassine?)@?\1@?"

output:

Traceback (most recent call last): File "C:\Users\Youness\Desktop\exrex-master\exrex.py", line 542, in <module> __main__() File "C:\Users\Youness\Desktop\exrex-master\exrex.py", line 529, in __main__ args['output'].write(next(g)) File "C:\Users\Youness\Desktop\exrex-master\exrex.py", line 126, in prods for o in orig: File "C:\Users\Youness\Desktop\exrex-master\exrex.py", line 84, in dappend yield cc + d[k] KeyError: 1

i think in case when no output will be generated due to all pattern are followed by ? then need to escape the null,empty error and not to raise it and continue till the end

zdilto avatar Oct 04 '19 08:10 zdilto