Skip to main content

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

Match Results
PathResult
No data yet
Was this helpful?

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

  1. Type a glob pattern in the first box (for example src/**/*.{js,ts}).
  2. Choose a Shell / Mode — Bash, Zsh, .gitignore, Python fnmatch or Go path.Match.
  3. 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, .gitignore and Go it stops at a / (it matches within a single path segment); in Python fnmatch it matches across / too.
  • ? — matches exactly one character (again, not / except in fnmatch).
  • ** — the "globstar": matches any number of path segments, including across /. Supported in Bash, Zsh and .gitignore. A trailing slash is optional, so src/**/x matches both src/x and src/a/b/x. Go's path.Match and Python fnmatch do 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, fnmatch or 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.

globshellbashgitignorepatternfnmatchwildcard

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.