Glob Pattern Tester
Test and validate glob patterns against file paths in real-time
Input
Output
| Path | Status |
|---|---|
| No data available | |
Readme
What are glob patterns?
Glob patterns are wildcard matching patterns used to specify sets of filenames or paths. They originated in Unix shells but are now used across programming languages and tools. Common wildcards include * (matches any characters), ** (matches directories recursively), ? (matches single character), and [abc] (matches any character in brackets). These patterns are essential for file operations, build tools, and version control systems like Git.
How do glob patterns work?
Glob patterns use special wildcard characters to match file paths. Here are the most common patterns:
*- Matches any number of characters within a single directory level- Example:
*.jsmatchesfile.js,test.jsbut notfolder/file.js
- Example:
- **
**** - Matches any number of directories (recursive matching)- Example:
**/*.jsmatchesfile.js,src/file.js,src/utils/file.js
- Example:
?- Matches exactly one character- Example:
file?.jsmatchesfile1.js,fileA.jsbut notfile10.js
- Example:
[abc]- Matches any single character from the set- Example:
file[123].jsmatchesfile1.js,file2.js,file3.js
- Example:
[a-z]- Matches any character in the range- Example:
[A-Z]*.jsmatches files starting with uppercase letters
- Example:
{js,ts}- Matches any of the comma-separated patterns (brace expansion)- Example:
*.{js,ts}matchesfile.jsandfile.ts
- Example:
!pattern- Negates the pattern (excludes matching files)- Example:
!*.test.jsexcludes all test files
- Example:
Practical examples:
src/**/*.{js,ts}- All JavaScript and TypeScript files in src directory and subdirectorieslib/**/test/*.js- All JavaScript files in test folders within lib**/*.min.js- All minified JavaScript files anywhere in the project!node_modules/**- Exclude everything in node_modules directory
Tool description
An online glob tester for testing and validating glob patterns against file paths in real-time. This glob pattern checker uses the picomatch library to provide accurate pattern matching, allowing developers to quickly test their glob expressions before implementing them in configuration files, scripts, or applications. The glob syntax tester interface provides instant feedback on which paths match your pattern, helping you refine and perfect your glob expressions with this intuitive glob expression tester.
Features
- Real-time pattern matching: Instantly see which paths match your glob pattern as you type with this online glob tester
- Multiple path testing: Test glob patterns against multiple file paths simultaneously
- Pattern options: Configure case sensitivity and dotfile matching behavior in the glob pattern checker
- Visual feedback: Clear indication of matching and non-matching paths with color-coded badges
- Tabular results: Organized display of test results in a clean, sortable table format
- Error handling: Immediate feedback on invalid glob syntax with error messages
- Match statistics: Summary showing the number of matches out of total paths tested
Use Cases
- Build configuration: Test glob patterns for build tools like Webpack, Vite, or Rollup before adding to config
- Git ignore patterns: Validate .gitignore patterns with this glob pattern tester to ensure they match the intended files
- File processing scripts: Verify glob expressions for file selection in Node.js scripts or automation tools
- Test file selection: Use the glob syntax tester to configure test runners (Jest, Mocha) to select correct test files
- ESLint and Prettier: Test file patterns with this glob expression tester for linter and formatter configuration
- Documentation: Verify glob patterns for documentation generators and file processors
- CI/CD pipelines: Test path matching patterns for continuous integration workflows with this online glob tester
- Learning glob syntax: Experiment with glob patterns in this glob pattern checker to understand their behavior