Skip to content
ZeroServer.tools

Glob Pattern Tester

Test glob patterns against file paths in your browser — supports * ? ** and {a,b} alternations.

Presets:
Total Paths
8
Matched
5
Unmatched
3
Match Rate
63%
5/8 matched
src/index.tsMatch
src/utils/helpers.tsMatch
src/utils/helpers.jsMatch
dist/bundle.jsNo Match
README.mdNo Match
src/components/Button.tsxNo Match
lib/math.tsMatch
src/api/routes.tsMatch

What is glob pattern matching?

Glob patterns are path expressions that match file system paths using wildcards. * matches any sequence of non-slash characters within a single path segment, ** matches across directory boundaries, ? matches a single non-slash character, and {a,b} matches either alternative. Glob patterns are used in .gitignore files, build tool configs (webpack, Vite, ESLint), CI pipelines, and shell commands. Use this tester to verify your patterns before committing them to a config file.

Built and maintained by Meet Shah · Last updated

What this tool is used for

  • Checking whether a pattern matches the paths you expect.
  • Testing an ignore pattern before adding it to a config.
  • Working out why a build is including or missing a file.
  • Comparing a single-star pattern against a double-star one.
  • Testing brace alternation before relying on it.

Frequently Asked Questions

What is the difference between * and **?
`*` matches within one path segment and stops at a slash; `**` crosses directory boundaries. So `src/*.ts` matches `src/index.ts` but not `src/utils/helpers.ts`, while `src/**/*.ts` matches both. Getting this wrong is why an ignore rule silently covers less than intended.
How does the brace expansion work?
`{a,b}` matches either alternative, so `*.{js,ts}` is shorthand for two patterns. It is not a wildcard — the list is literal alternatives — and it nests, so `src/**/*.{spec,test}.{js,ts}` covers four combinations from one line.
Do globs match dotfiles?
Usually not by default. Most implementations exclude names starting with a dot unless a `dot` option is set, on the reasoning that `*` should not sweep up `.git` and `.env`. It is why a build script that appears to copy everything quietly skips your config files.
Is glob syntax the same everywhere?
No, and this is the practical trap. `.gitignore`, `tsconfig.json`, ESLint, shell expansion and the various Node glob libraries all differ on brace support, on whether a trailing slash means directory-only, and on negation. Test a pattern against the tool that will actually run it.
How is a glob turned into a match?
By translating it to a regular expression: `*` becomes "any character except a slash, repeated", `**` becomes "anything", `?` becomes one non-slash character, and braces become an alternation group. Every glob library is a variation on that translation, which is why they diverge in the corners.

Common errors and gotchas

  • Assuming `*` crosses directory separators, which it does not — that is what `**` is for.
  • Expecting dotfiles to match, which most implementations exclude by default.
  • Assuming one glob dialect, since shells, build tools and libraries differ on extensions.
  • Testing a pattern against a path with the wrong separator for the platform.
  • Anchoring a pattern differently from the tool that will use it, which changes every match.

Related Developer Utilities tools

Private & free — this tool runs entirely in your browser.

IndieKitShip your Next.js startup in days.affiliate