isaacs / minimatch

a glob matcher in javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Match fails if tested string contains slash

thybzi opened this issue · comments

Minimatch 3.0.4 doesn't match if tested string contains slash.

The most simple example is:

minimatch('foo bar', 'foo*'); // => true
minimatch('foo/bar', 'foo*'); // => false

Is it an expected behavior? How can I override it?

P.S. I've looked through all issues mentioning slashes, but most of them are about the dot, and then one of timezones (#120) seemed to be about pattern, not tested string

Yeah, this is how glob works. * doesn't match /.

Maybe you could use /** to mean "zero or more path portions"?

> minimatch('foo/bar', 'foo*/**')
true