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

Does not handle + properly #45

Closed
UltCombo opened this issue Nov 8, 2015 · 8 comments
Closed

Does not handle + properly #45

UltCombo opened this issue Nov 8, 2015 · 8 comments
Labels

Comments

@UltCombo
Copy link
Contributor

UltCombo commented Nov 8, 2015

Test case:

micromatch.isMatch('coffee+/src/glimini.js', 'coffee+/src/**');

Actual: false
Expected: true

Tested with micromatch@2.2.0.

@jonschlinkert
Copy link
Member

thanks for reporting. I'll look into it asap

@jonschlinkert
Copy link
Member

this should be a pretty simple fix. basically + is recognized as a regex character, so it's trying to match one or more e characters, but we need it to match a literal + instead. I'll get a patch pushed up.

@UltCombo
Copy link
Contributor Author

UltCombo commented Nov 9, 2015

That makes sense. Though, as far as I can see, the + character is properly listed in the chars.escapeRegex object. I'm not familiar enough with this code base to find what is going wrong.

@jonschlinkert
Copy link
Member

no worries, I'll track it down. I'm pretty sure I know where it is. that character is used in both extglobs and brace expansion - but, neither would be causing this issue since they match fairly specific patterns.

if you have any more ideas for test cases I can add to the unit tests, that would be great.

@jonschlinkert
Copy link
Member

@UltCombo could you try your test case against this patch and see if that works for you?

@UltCombo
Copy link
Contributor Author

UltCombo commented Nov 9, 2015

Oh nice, I'll try it tonight. 😄

@UltCombo
Copy link
Contributor Author

Works great, thanks for the quick fix! 😸

@jonschlinkert
Copy link
Member

great! no problem of course, I appreciate you creating an issue. I'll get a patch pushed up shortly

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