Glob Pattern Tester

Test glob patterns against file lists in real-time. Supports wildcards (*, **), character classes ([abc]), brace expansion ({a,b}), and negation patterns.

Common Patterns:
Results Label3 / 20 matched
  • src/index.ts
  • src/app.tsx
  • src/components/Button.tsx
  • src/components/Modal.tsx
  • src/utils/helpers.ts
  • src/utils/format.js
  • src/hooks/useAuth.ts
  • src/styles/global.css
  • tests/app.test.ts
  • tests/utils.test.js
  • package.json
  • tsconfig.json
  • README.md
  • node_modules/react/index.js
  • dist/bundle.js
  • public/logo.png
  • public/favicon.ico
  • docs/guide.md
  • src/assets/hero.jpg
  • src/assets/icon.svg

Syntax Title

*Any characters except path separator
**Any characters including path separators (recursive)
?Any single character
[abc]Syntax Bracket
{a,b}Syntax Brace
!Syntax Negate

How to Test Glob Patterns Online

  1. 1

    Enter your glob pattern

    Type or paste a glob pattern into the pattern input field. Use wildcards like *, **, character classes like [abc], or brace expansions like {js,ts}. You can also select from common preset patterns.
  2. 2

    Add your file list

    Paste your project's file paths into the file list area, one path per line. You can copy file paths from your terminal using find . -type f or git ls-files to get a real file tree from your project.
  3. 3

    Review matched files instantly

    The tool highlights matching files in real-time as you type. Green-highlighted paths match your pattern, making it easy to spot both intended matches and unexpected inclusions.
  4. 4

    Refine and copy results

    Adjust your pattern until only the desired files match. Use the Copy Matches button to grab the matched file list, ready to paste into your .gitignore, CI config, or build tool configuration.

Common Use Cases

1

Configuring .gitignore Files

Test patterns before adding them to .gitignore to ensure you exclude build artifacts, node_modules, and environment files without accidentally ignoring source code. Avoid costly mistakes where important files get excluded from version control.
2

Build Tool and Bundler Configuration

Verify file inclusion patterns for webpack, Vite, Rollup, or esbuild configs. Test entry points like src/**/*.{ts,tsx} to confirm the right source files are picked up during builds without pulling in test or config files.
3

CI/CD Pipeline File Filters

Configure path-based triggers in GitHub Actions, GitLab CI, or other CI systems. Test patterns like src/** or *.{yml,yaml} to ensure pipelines only run when relevant files change, saving build minutes.
4

Linter and Formatter Scope

Define which files ESLint, Prettier, or Stylelint should process. Test glob patterns for .eslintignore or .prettierignore to confirm your tooling targets the correct files and skips generated or vendor code.

Why Use Our Glob Pattern Tester?

Glob patterns are used everywhere — in .gitignore files, CI/CD configurations, build tools, and shell commands. Getting them wrong can include unwanted files or miss critical ones. Our tester lets you paste your file list and test patterns instantly in the browser. No installation needed, and it supports all standard glob syntax including **, brace expansion, and negation.

Glob patterns are a concise wildcard syntax for matching file and directory paths. They originated in early Unix shells and are now fundamental to modern development workflows. Every time you write a .gitignore rule, configure a webpack entry point, set up a CI/CD path filter, or run a shell command like ls *.json, you are using glob patterns. This tool lets you test those patterns against a real file list instantly in your browser, with zero setup and no server-side processing.

Under the hood, this tester implements the same matching algorithm used by popular JavaScript glob libraries including micromatch and minimatch. These libraries power the file matching in tools like webpack, Babel, Jest, ESLint, Prettier, and lint-staged. Patterns you validate here will behave identically in those environments. The supported syntax includes single-star wildcards (*), globstar recursive matching (**), single-character wildcards (?), character classes ([abc], [0-9]), brace expansion ({js,ts}), and negation (!). If you need more powerful text matching beyond file paths, try our Regex Tester for full regular expression support.

Unlike command-line testing where a wrong glob pattern can accidentally delete or include unintended files, this browser-based tester provides a safe sandbox. You can experiment freely, see matches highlighted in real-time, and iterate on your pattern until it is exactly right. The tool works entirely client-side — your file paths never leave your browser. Whether you are writing Dockerfiles, configuring YAML-based CI pipelines, debugging why ESLint skips certain files, or crafting the perfect .gitignore, this glob pattern tester gives you instant visual feedback before you commit your configuration.

How It Compares

Most developers test glob patterns by trial and error in the terminal — running ls or find commands and checking the output. This is slow, risky in production directories, and does not show you which files were excluded. Online alternatives either require pasting patterns into documentation-style syntax checkers without real file lists, or they use server-side processing that introduces privacy concerns.

This glob pattern tester runs entirely in your browser with instant visual feedback as you type. You see both matched and unmatched files highlighted simultaneously, making it easy to catch patterns that are too broad or too narrow. Unlike regex testers that focus on arbitrary text, this tool is purpose-built for file path matching — supporting path separators, directory recursion with **, and brace expansion that standard regex tools do not handle natively. It is the fastest way to validate glob patterns for .gitignore, webpack, Docker, CI/CD configs, and any tool that uses file globbing.

Tips & Best Practices

1
Always test ** patterns carefully — src/** matches everything inside src/ recursively, including deeply nested files that you might not expect.
2
Use brace expansion to combine related patterns: *.{js,jsx,ts,tsx} is cleaner and more maintainable than four separate patterns.
3
Remember that * does not match across directory separators. Use **/filename to find a file at any depth in the directory tree.
4
When building .gitignore rules, test both the inclusion and exclusion patterns together. A negation pattern (!important.log) only works if a previous pattern matched that file.
5
Character classes [0-9] and [a-z] work in glob patterns just like in regex. Use them to match numbered files like log-[0-9]*.txt or versioned assets.

Frequently Asked Questions

1

What is a glob pattern?

A glob pattern is a wildcard syntax used to match file paths. Common in shell commands (ls *.txt), .gitignore files, and build tools. Key operators: * matches any characters except /, ** matches across directories, ? matches a single character.
2

What is the difference between * and **?

* matches any characters within a single directory level (e.g., src/*.js matches src/index.js but not src/lib/utils.js). ** matches across multiple directory levels (e.g., src/**/*.js matches both).
3

How do brace expansions work?

Braces create comma-separated alternatives. For example, *.{js,ts} matches both .js and .ts files. {src,lib}/**/*.tsx matches .tsx files in either src/ or lib/ directories.
4

Can I use this for .gitignore patterns?

Yes, the syntax is very similar. You can test your .gitignore patterns here to verify they match the correct files before adding them to your repository.
5

Is this tool free to use?

Yes, completely free with no signup required. All pattern matching happens in your browser — nothing is uploaded to any server.

Rate This Tool

0/1000

Get Weekly Tools

Suggest a Tool