What is a glob pattern?
A glob (short for "global") pattern is a compact way to describe a set of file paths using wildcards instead of listing every path by hand. Tools like .gitignore, tsconfig.json's exclude array, ESLint's ignorePatterns, Webpack/Vite includes, and shell commands all accept globs. The core symbols are * (any characters except /), ** (any number of directories, the "globstar"), ? (exactly one character), [abc] / [a-z] / [!abc] (a character class, optionally negated), and {a,b,c} (brace expansion into alternatives). Most real-world configs also support !pattern lines that re-include a path an earlier line excluded — the same mechanism .gitignore uses to carve out exceptions.
Why globstar (**) semantics matter
A common source of bugs is assuming * crosses directory boundaries the way ** does. src/*.js only reaches one level deep, so it silently misses src/utils/helpers.js. Swapping in src/**/*.js fixes it because ** occupies its own path segment and can expand to zero or more directory levels. This tool builds the exact same regex a globstar-aware matcher (like minimatch or the git ignore engine) would build, so what you see here is what tools like Git, ESLint, and TypeScript will actually do.
Example 1 — globstar with negation
Pattern (evaluated top to bottom, like .gitignore)
**/*.js !**/*.test.js
Input paths
src/index.js src/components/Button.test.js node_modules/lodash/index.js README.md
Output — matched
src/index.js node_modules/lodash/index.js
Every .js file matches line 1, but Button.test.js is re-excluded by line 2 because !**/*.test.js runs after and wins. README.md never matched line 1 at all.
Example 2 — brace expansion + character class
Pattern
src/**/*.{js,ts}
!src/**/v[0-2]/**
Input paths
src/app.js src/lib/util.ts src/v1/legacy.ts src/app.md
Output — matched
src/app.js src/lib/util.ts
{js,ts} expands to two alternatives so both extensions match line 1. src/v1/legacy.ts matches line 1 too, but line 2's character class [0-2] matches the "1" in v1, so the negation removes it. src/app.md never matched any .js/.ts pattern.
Frequently asked questions
How does ** (globstar) differ from a single *?
A single * matches any run of characters but never crosses a / — so src/*.js only matches files directly inside src/, not src/utils/helpers.js. A double ** is a globstar: when it occupies its own path segment (surrounded by / or the start/end of the pattern) it matches zero or more whole directory levels. src/**/*.js matches src/index.js, src/utils/helpers.js, and src/a/b/c/deep.js, because ** absorbs any number of intermediate directories, including none.
Does this tool follow .gitignore semantics or shell glob semantics?
It follows gitignore/minimatch-style semantics rather than strict POSIX shell glob rules, because that's what most developers mean when they paste a glob into a config file. Concretely: a pattern with no slash matches at any depth (like a bare filename in .gitignore), a pattern starting with / is anchored to the root, a trailing / matches a directory and everything under it, and lines can be negated with a leading ! to re-include a path an earlier line excluded.
How does the ! negation work with multiple pattern lines?
Enter one pattern per line, just like a .gitignore file. Each path is checked against every line from top to bottom; whichever line matches last decides the final match state. So **/*.js on line one followed by !**/*.test.js on line two matches every .js file except test files, because the negated line runs after the positive one and wins for any path it also matches. Lines starting with # are treated as comments and ignored.
What do [abc], [a-z] and [!abc] mean?
Square brackets define a character class that matches exactly one character from the set. [abc] matches a single a, b, or c; [a-z] matches any single lowercase letter using a range; and a leading ! or ^ inside the brackets negates the class, so [!0-9] matches any single character that is not a digit. log[0-9].txt therefore matches log1.txt and log9.txt but not loga.txt or log10.txt (which has two digits).
How does brace expansion {a,b,c} work?
Curly braces list literal alternatives that get expanded into separate patterns before matching, similar to shell brace expansion. src/**/*.{js,ts,tsx} is equivalent to testing src/**/*.js OR src/**/*.ts OR src/**/*.tsx against every path in one go, which is the common way to match a small set of extensions without writing three separate lines.
Does this tool send my paths or patterns anywhere?
No. Pattern parsing, brace expansion, and matching all run in plain JavaScript in your browser using regular expressions built on the fly. There is no server call and no network request after the page loads, so it keeps working offline and is safe to use with internal file structures or proprietary paths.