Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

I'm not trying to precisely match the behaviour of an existing glob syntax unless that behaviour really seems like the most obvious/easiest-to-use syntax. However, I do want globs to feel familiar to use.

I'll say that '**' matches anything, and '*' matches anything except directory separators. Without thinking too hard, how do you expect the following globs to behave?

  1. *.c
  2. **.c
  3. **/*.c
  4. src/*/*.c
  5. src/**

More specifically:

  1. Should '*.c' match '.c'?
  2. Should '**.c' match '.c'?
  3. Should '**/*.c' match 'foo.c'? Should it match 'foo/.c'?
  4. Should 'src/*/*.c' match 'src/foo.c'?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment