-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Exception with EXTMATCH on pattern like '!(not)_@(this|that)' #218
Labels
S: triage
Issue needs triage.
Comments
Yeah, the negate case in >>> fnmatch.fnmatch('1_foo', '!(2)_@(foo|bar)', flags = fnmatch.EXTMATCH)
True |
facelessuser
added a commit
that referenced
this issue
May 15, 2024
facelessuser
added a commit
that referenced
this issue
May 15, 2024
I've tagged a new release. It should be available shortly on PyPI. |
Nice, thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using a pattern like
!(not)_@(this|that)
and EXTMATCH an exceptionmissing ), unterminated subpattern at position 5
is raised. The issue happens when a!(pattern-list)
is followed by a@(pattern-list)
.As a trivialized example say I have the files
1_foo
,2_foo
and3_bar
and I want to match all files except the 2nd, I could use a pattern!(2)_@(foo|bar)
. Matching the 1st file like this:Should result
True
but instead the fnmatch call raises this exception:In bash it works:
The text was updated successfully, but these errors were encountered: