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

Incorrect matching with curly braces and globstar #8

Closed
mrmlnc opened this issue Feb 20, 2019 · 1 comment
Closed

Incorrect matching with curly braces and globstar #8

mrmlnc opened this issue Feb 20, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@mrmlnc
Copy link
Contributor

mrmlnc commented Feb 20, 2019

Source

Actual behavior

The following filepathes is not matched by minimatch, micromatch and picomatch for the {file.txt,directory/**/*} pattern.

directory/.test.txt
directory/test.txt

But if you remove the /* part of the pattern, everything works correctly.

Expected behavior

Will be matched or documented :)

Code sample

Works fine:

picomatch.makeRe('{file.txt,directory/**}', { dot: true });

Works bad:

picomatch.makeRe('{file.txt,directory/**/*}', { dot: true });
@jonschlinkert
Copy link
Member

jonschlinkert commented Feb 20, 2019

Thanks for the issue. Good timing too, since I'm working on this again this week, to publish the next version of micromatch.

Edit: actually I'm wondering if that is the correct result. I'm pretty sure that when you specify **/*, that means "any number of directories, followed by at least one more directory". Also, I'm pretty sure that /* usually means "one directory", not "zero or one". But given that there is no actual specification for globs and it works differently in different tools, I'm open to feedback.

Edit 2: nevermind, ignore my previous comment, I was thinking the glob would have a file after **/*, but it wouldn't. You were correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants