Glob Pattern Tester | Test & Debug File Matching Patterns Online

Home » Glob Pattern Tester | Test & Debug File Matching Patterns Online

Configuration

Use * for wildcards, ** for recursive, ! to negate.

Results 0 matches

Regex Preview

About Glob Pattern Tester

Welcome to the most efficient and user-friendly Glob Pattern Tester on the web. Whether you are configuring a build tool like Webpack, setting up ignore files for Git, or filtering files in a Node.js application, getting your glob patterns right is crucial.

This tool allows you to write glob patterns and instantly see which file paths they match. It runs entirely in your browser, ensuring your data remains private and your experience is lightning fast.

How to Use

  • Enter a Pattern: Type your glob pattern in the top input field. Common patterns include *.js for all JavaScript files or src/** for everything in the src folder.
  • Add Test Strings: Paste a list of file paths in the text area. You can also use the "Generate Mock Files" button to populate it with sample data.
  • View Results: The right-hand panel updates in real-time, highlighting matches in green.
  • Share: Click the "Share" button to generate a unique URL with your current configuration to send to teammates.

Common Glob Syntax Tips

  • * : Matches any number of characters, but not path separators (/).
  • ** : Matches any number of characters, including path separators. Used for recursive matching.
  • ? : Matches exactly one character.
  • {} : Brace expansion. Example: *.{js,ts} matches both .js and .ts files.
  • ! : Negation. Add at the beginning to exclude matches.

Frequently Asked Questions

What is the difference between * and **? +
The single asterisk * matches files within a single directory. The double asterisk ** is a "globstar" that matches across multiple directory levels recursively.
Can I use this for .gitignore files? +
Yes! Gitignore uses glob patterns. You can test your ignore rules here to ensure you aren't accidentally ignoring important files or including unwanted ones.
Is my data sent to a server? +
No. This tool is 100% client-side. All processing happens in your browser using JavaScript.
Link copied to clipboard!

 

Read Also: