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

backreference issue #43

Open
zdilto opened this issue Oct 4, 2019 · 0 comments
Open

backreference issue #43

zdilto opened this issue Oct 4, 2019 · 0 comments
Labels

Comments

@zdilto
Copy link

zdilto commented Oct 4, 2019

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

@asciimoo asciimoo added the bug label Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants