Shell Glob Pattern Tester
Test a shell glob pattern against a list of file paths and see which ones match. Supports *, ?, ** globstar, [abc] character classes, {a,b} brace expansion and ! negation across Bash, Zsh, .gitignore, Python fnmatch and Go path.Match semantics.
Input
Use * (any chars), ? (one char), ** (any path), [abc] (char class), {a,b} (alternatives). Prefix with ! to invert.
Different shells interpret *, **, ? and braces differently.
Output
| Path | Result |
|---|---|
| No data yet | |
Guides
Glob patterns are the wildcard mini-language shells use to match filenames — *.js, src/**/*.ts, [Rr]eadme.md. They look simple, but the exact rules differ from one tool to the next: what * matches in Bash isn't what it matches in Python's fnmatch, and .gitignore treats ** unlike a plain shell. This tester lets you paste a pattern and a list of paths, pick the flavour you care about, and instantly see which paths match and which don't — no shell, no trial-and-error ls.
How to use it
- Type a glob pattern in the first box (for example
src/**/*.{js,ts}). - Choose a Shell / Mode — Bash, Zsh,
.gitignore, Pythonfnmatchor Gopath.Match. - Paste your file paths, one per line.
The results table updates as you type, marking each path Match or No match. You can copy the table or download it as CSV.
Glob syntax supported
*— matches any run of characters. In Bash, Zsh,.gitignoreand Go it stops at a/(it matches within a single path segment); in Pythonfnmatchit matches across/too.?— matches exactly one character (again, not/except infnmatch).**— the "globstar": matches any number of path segments, including across/. Supported in Bash, Zsh and.gitignore. A trailing slash is optional, sosrc/**/xmatches bothsrc/xandsrc/a/b/x. Go'spath.Matchand Pythonfnmatchdo not support**.[abc]/[a-z]— a character class matching one listed character.[!abc]or[^abc]negates the set. Supported in every mode.{a,b,c}— brace expansion into alternatives, and combinations across multiple groups ({a,b}{1,2}→a1 a2 b1 b2). Supported in Bash and Zsh only — not in.gitignore,fnmatchor Go.!pattern— a leading!inverts the whole result, so paths that would not match are the ones reported as matches (handy for.gitignore-style negations).\— a backslash escapes the next character so a literal*,?,[or{is matched as itself.
Why do the modes give different results?
Each ecosystem made its own choices. Bash and Zsh keep * inside one directory level and add ** for crossing them; Python's fnmatch was designed for flat filenames, so its * happily swallows /; Go's path.Match is deliberately minimal (no **, no braces); .gitignore supports ** and classes but not brace expansion. Picking the right mode matters — a pattern that works in your shell may behave differently in a .gitignore file or a language library.
Privacy
Everything runs in your browser. Your patterns and file paths are matched locally and never leave your device.