Glob Pattern Tester
Test glob patterns like src/**/*.ts against a list of file paths and see matches instantly, with the compiled regex shown. Supports *, **, ?, [abc] and {a,b}.
Matched (3)
- src/index.ts
- src/lib/utils.ts
- src/lib/utils.test.ts
Not matched (4)
- src/app/page.tsx
- docs/readme.md
- package.json
- test/setup.js
Compiled regular expression
/^src\/(?:[^/]+\/)*[^/]*\.ts$/
Convention used: * and ? never cross a slash, ** matches any number of directories, dotfiles are matched.
What is the Glob Pattern Tester?
The ByteTools Glob Pattern Tester shows you exactly which file paths a glob pattern matches. Enter a pattern like src/**/*.
- Supports *, **, ?, [abc], [!abc], {a,b} and leading ! negation
- Live matched/unmatched split with counts as you type
- Shows the regular expression the glob compiles to
- Optional case-insensitive matching
- Handles ** correctly: matches zero or more whole directories
- 100% client-side — paths never leave your browser
How to use the Glob Pattern Tester
- 1
Enter a glob pattern, e.g. src/**/*.test.ts.
- 2
Paste your file paths, one per line.
- 3
Review the live matched and unmatched lists with their counts.
- 4
Inspect the compiled regular expression to understand the pattern.
About the Glob Pattern Tester
The ByteTools Glob Pattern Tester shows you exactly which file paths a glob pattern matches. Enter a pattern like src/**/*.ts, paste a list of paths — one per line — and watch them split live into matched and unmatched, with counts for each.
It supports the syntax used by .gitignore rules, CI path filters, tsconfig includes and bundler configs: * for anything within one path segment, ** for any depth of directories, ? for a single character, [abc] character classes, {a,b} alternation and a leading ! to negate the whole pattern. The regular expression the pattern compiles to is displayed, which makes it a great way to learn what globs really do.
Matching runs entirely in your browser as you type, so you can iterate on a pattern until it selects exactly the files you intend — before it silently excludes half your build.
Frequently asked questions
What is the difference between * and ** in a glob?
A single * matches any characters within one path segment — it never crosses a slash. A double ** matches any number of whole directories, including none, so src/**/*.ts matches src/a.ts as well as src/deep/nested/b.ts.
Why does *.ts not match src/app.ts?
Because * stops at slashes, *.ts only matches .ts files in the top level. To match TypeScript files at any depth use **/*.ts.
How does {a,b} alternation work?
The pattern matches with each alternative in turn: *.{js,ts} is equivalent to *.js OR *.ts. You can use it anywhere in the pattern, like src/{components,pages}/**.
What does a leading ! do?
It negates the pattern: paths that would have matched are excluded, and everything else matches. Tools like .gitignore use ! lines to re-include files that an earlier pattern excluded.
Do all tools implement globs the same way?
The core (*, **, ?, classes) is consistent, but edge cases differ: some tools require ** to be its own path segment, some match dotfiles with * and some do not. This tester uses the common convention that * and ? do not cross slashes and dotfiles are matched — always check your specific tool's docs for its dotfile rule.
Can I see the regex behind my glob?
Yes — the compiled regular expression is displayed under the results. It is a faithful translation you can reuse in code, and reading it is a quick way to understand exactly why a path did or did not match.
Related tools
.gitignore Generator
Build a .gitignore file by selecting your stack — Node, Python, Java, Go, Rust, Unity, macOS, Windows, IDEs — merged, de-duplicated and ready to download.
Regex Tester
Test regular expressions online with live match highlighting, capture groups and flag toggles (g, i, m, s, u, y). Free, instant and 100% private in your browser.
Semantic Version Checker
Validate semantic versions, compare two versions with correct pre-release precedence, sort a whole list, and see the next major, minor and patch increments.
Slug Generator
A free online slug maker that turns any title into a clean, SEO-friendly URL slug: lowercase, accents removed, words joined by hyphens. Live preview and copy.