micromatch / braces

Faster brace expansion for node.js. Besides being faster, braces is not subject to DoS attacks like minimatch, is more accurate, and has more complete support for Bash 4.3.
https://github.com/jonschlinkert
MIT License
225 stars 62 forks source link

Dot character not working as it should (escape + expansion) #9

Closed wc-matteo closed 8 years ago

wc-matteo commented 8 years ago

Input

{1\\.2}

Output

{1\\.2}

Expected

{1.2}

I wanted to escape the dot to get this to work:

{{a,b,c},foo.bar/{a,b,c}}/**/*.baz

Output

[ 'c', 'foo.bar/c' ]

Expected

[ 'a/**/*.baz',
  'foo.bar/a/**/*.baz',
  'foo.bar/b/**/*.baz',
  'foo.bar/c/**/*.baz',
  'b/**/*.baz',
  'c/**/*.baz' ]

But why should I escape the dot? As far as I know, it doesn't carry any particular meaning in glob patterns...

jonschlinkert commented 8 years ago

Ironically I just found this bug myself while refactoring the parser. It's surprising that it hasn't been noticed before now. thanks for the issue