Glob Pattern Tester
Glob patterns
Paths
Results
Syntax cheatsheet
- *
- Any characters within one path segment (does not match /)
- **
- Any number of path segments, including none
- ?
- Exactly one character (not /)
- [abc]
- One character from the set; [a-z] for a range, [!abc] to negate
- {a,b}
- Alternatives, e.g. *.{ts,tsx}, or ranges like {1..3}
- !(x)
- Anything except the listed alternatives, e.g. !(*.test).ts
- +(x)
- One or more of the listed alternatives, e.g. +(a|b)
- @(x)
- Exactly one of the listed alternatives, e.g. @(js|ts)
Technical details
How the Glob Pattern Tester Works
What the Tool Does
The Glob Pattern Tester checks one or more glob patterns against a list of file paths and marks each path as matched or unmatched. Patterns are evaluated in order, gitignore-style: a pattern starting with ! removes paths from the result and later patterns override earlier ones. Each result shows which pattern made the final decision, and you can inspect the regular expression picomatch compiles for every pattern. Everything runs in your browser.
Common Developer Use Cases
Developers use glob testers to debug include and exclude lists in tsconfig.json, ESLint and Prettier ignore files, Jest and Vitest test patterns, GitHub Actions path filters, bundler configuration and CI cache keys. It is also handy for checking .gitignore and .dockerignore rules before committing, and for understanding why a build tool picks up, or silently skips, a particular file.
Data Formats, Types, or Variants
The default mode uses picomatch, the matcher behind micromatch and many build tools, with support for * and ** wildcards, ? single characters, [abc] character classes, {a,b} brace alternatives and extglobs such as !(x), +(x) and @(x). The optional .gitignore mode adds gitignore rules: patterns without a slash match at any depth, a leading slash anchors to the root and a trailing slash matches directories only. Subdirectory .gitignore files and the rule that a file cannot be re-included once its parent directory is excluded are not modelled.
Common Pitfalls and Best Practices
Wildcards do not match dotfiles unless the dot option is on or the dot is written explicitly, so **/* skips .github and .env. * never crosses a slash, so *.ts matches only top-level files; use **/*.ts for any depth. Order matters with negation: a ! pattern only excludes paths matched by an earlier pattern. Glob matching is case-sensitive by default, and different tools (minimatch, micromatch, shell globbing, .gitignore) have subtle differences, so confirm results in the tool you actually deploy with.