Glob Pattern Tester
Test a glob pattern (** ? *) against a path list, and show its regex.
Overview
Paste a glob pattern (src/**/*.ts, !**/node_modules) and a list of paths and see which paths match. The tool also shows the regex equivalent of your glob, so you can confirm what * vs ** actually expands to.
It's for developers writing .gitignore entries, ESLint ignorePatterns, Webpack include/exclude, GitHub Actions paths: filters, or any tooling that consumes glob syntax. Reach for it when a workflow isn't triggering on the file you expected, or when a deploy script copies files it shouldn't.
How it works
Glob patterns are a Unix shell tradition with subtle differences across tools. The tester follows the minimatch / picomatch flavour - the de facto standard for Node tooling and most CI platforms: * matches any characters except /, ** matches any number of path segments (including zero), ? matches a single non-separator character, [abc] is a character class, and ! at the start negates.
Brace expansion ({js,ts}) is supported. Patterns are compiled to a regex internally; the regex form is exposed so you can verify the exact match semantics.
Examples
- Match nested TypeScript files:
Pattern: src/**/*.ts Matches: src/index.ts, src/utils/format.ts Skips: src/types.d.ts (if .d.ts is excluded separately) - Brace expansion:
Pattern: **/*.{js,ts,jsx,tsx} - Negation:
Pattern: !**/node_modules/** Matches: everything except node_modules trees - Single segment vs deep:
Pattern: docs/*.md -> matches docs/intro.md but not docs/api/v1.md Pattern: docs/**/*.md -> matches both
FAQ
Is glob a regex?
No - it's a separate, simpler pattern syntax. The tester shows the equivalent regex so you can compare behaviour and use one if the other isn't supported.
Why doesn't * match across directories?
By design - * is one segment only. Use ** for cross-directory matching. This is universal across glob implementations.
Are leading dots matched by *?
By default no - *.txt skips .hidden.txt. Most globbers expose a dot: true option to include dotfiles.
Do globs match directories or files?
Both, unless the pattern is anchored with a trailing /. Tools like .gitignore treat trailing / as directory-only.