Glob Pattern Tester
Test glob patterns with *, **, ?, character classes, braces and ! negation against a list of paths, and see which pattern decided each one.
Free · No sign-up · Your inputs stay in your browser
Input
Test glob patterns against paths
Output
2 of 6 match
| Path | Result | Decided by |
|---|---|---|
| src/index.ts | match | src/**/*.{ts,tsx} |
| src/components/Button.tsx | match | src/**/*.{ts,tsx} |
| src/components/Button.test.ts | no | !src/**/*.test.ts |
| src/.cache/x.ts | no | - |
| README.md | no | - |
| tests/app.ts | no | - |
| src/**/*.{ts,tsx} | ^src\/(?:(?!\.)[^/]*\/)*(?!\.)[^/]*\.(?:ts|tsx)$ |
|---|---|
| !src/**/*.test.ts | ^src\/(?:(?!\.)[^/]*\/)*(?!\.)[^/]*\.test\.ts$ |
* matches within one path segment and ** across any number of them; ? is one character, [abc] a set and {a,b} alternatives. This follows the shared core of minimatch, fast-glob and Bash globstar. .gitignore differs: a pattern without a slash matches at any depth, and a trailing slash matches directories only.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
One star or two
src/* matches files directly in src; src/** matches everything below it at any depth, and src/**/*.ts every TypeScript file in the tree. Dotfiles are skipped unless the pattern names the dot or dotfiles are enabled, which is the default in Bash, minimatch and fast-glob, and the reason .env survives a rm *.
Where globs differ
Tools agree on this core and differ at the edges. .gitignore matches a pattern without a slash at any depth and treats a trailing slash as directories only. Bash needs shopt -s globstar for **. Docker's .dockerignore follows Go's filepath.Match rules plus **. Test against the tool that will read the pattern.