Glob Tester

Test glob patterns against a list of file paths in real-time.

🔒 Client · Offline
Each flavor reads the same pattern with different rules.
The last pattern that matches decides the result. A leading ! excludes a path.
Presets:
Match Results3 of 9 included

src/index.ts

Rule 1: src/**/*.ts

Included

src/utils/math.ts

Rule 1: src/**/*.ts

Included

src/utils/math.test.ts

Rule 3: !src/**/*.test.ts

Excluded

src/components/Header.vue

Rule 2: src/**/*.vue

Included

tests/unit/app.test.ts

No rule matched

Excluded

dist/bundle.js

No rule matched

Excluded

logs/debug.log

No rule matched

Excluded

package.json

No rule matched

Excluded

docs/README.md

No rule matched

Excluded

About glob patterns

A glob pattern selects files by name. This tool tests an ordered list of patterns against a list of paths. Each result row shows the rule that decided the result, so you can correct a rule before you use it.

Pattern syntax

  • * matches any characters in one folder segment.
  • ** matches across folders at any depth.
  • ? matches one character.
  • {a,b} matches any of the comma-separated options.
  • [a-z] matches one character in the range. [!a-z] matches one character outside the range.
  • !pattern excludes a path.

Rule order

The tool reads the patterns from the top down and keeps your order. The last pattern that matches decides the result. A path that no pattern matches is excluded. The tool does not move an exclude rule ahead of an include rule, so a ! rule on the first line has no effect on a path that a later rule includes.

Flavor differences

Flavor Rules
Standard glob The pattern must match the full path. * and ? stop at a folder separator. ** crosses folders. {a,b} and +(a|b) expand. A pattern must start with a dot to match a dot file.
.gitignore A pattern with no slash matches at any depth. A leading / anchors the pattern to the root. A trailing / matches a directory only. A rule on a folder also selects the content of the folder. A line that starts with # is a comment. Git expands no braces and no extglobs, so {a,b} is literal text. A dot file is a normal name.
minimatch The same syntax as the standard flavor. minimatch is the matcher in ESLint, npm, and Prettier. It reads the same patterns as picomatch, the engine of this tool.

Limits

  • The tool has no filesystem. It reads your paths as text. A path that ends with / is a directory. For any other path the tool cannot know the type, so a directory-only rule such as build/ does not match it.
  • The tool tests one list of rules. It does not read a nested .gitignore file and it applies no file precedence. The result is close to git, but it is not full .gitignore parity.
  • The engine is picomatch with the POSIX separator. Another operating system, shell, or library can give a different result for the same pattern.
  • The minimatch flavor uses the same engine. Two differences are known: this tool matches the bare folder a against a/** and minimatch does not. This tool matches a//b against a/*/b and minimatch does not.