About this tool
Test whether a glob pattern (with * and ?) matches a string, and see the regex it compiles to.
The Glob Pattern Tester answers whether a glob matches a given string and shows the exact regular expression it compiles to: * becomes .*, ? becomes . , every other regex metacharacter is escaped literally, and the whole thing is anchored with ^ and $. Type a pattern like *.js and a string like app.js, toggle case-insensitivity if you need it, and you get a yes/no plus the compiled regex source. It is for developers debugging an ignore rule, a CI path filter or a config glob that is matching more or less than they expected.
Open Glob Pattern Tester on AltFTool — it loads instantly in your browser.
Enter a glob pattern into the Glob pattern field, using * to represent any run of characters and ? for a single character, to see how it matches against your test string.
Input a test string to check against the glob pattern, considering factors like character sequences and pattern specificity.
Choose whether to perform a case-insensitive match to account for variations in string case, ensuring your pattern works as expected across different scenarios.
The exact anchored pattern source is printed, so you can paste it straight into code or see why an unexpected character changed the match.
The compiled expression is anchored at both ends, so a pattern must consume the entire string — no accidental substring matches to mislead you.
Toggling ignore-case adds the regex i flag, which lets you reproduce the difference between a case-sensitive Linux runner and a case-insensitive macOS or Windows filesystem.
Two: * matches any run of characters including none, and ? matches exactly one character. Everything else — dots, plus signs, brackets, braces, parentheses — is escaped and matched literally, so *.js matches app.js but not appxjs.
There is no separate ** behaviour here. Because * compiles to .*, which also matches the / character, a single * already crosses directory boundaries — src/*/index.ts will match src/a/b/index.ts. That differs from tools like Git and most build systems, where a single * stops at a slash and you need ** to descend, so verify path-heavy patterns against your actual tool.
^.*\.js$ — the star becomes .*, the dot is escaped to \., and ^ plus $ anchor the whole string. With the ignore-case toggle on, the same source is compiled with the i flag so App.JS also matches.
Because matching is all-or-nothing against the full test string. A pattern like *.js will not match a bare js or a trailing fragment, and an empty pattern returns no result at all — add a leading * if you intended a suffix match rather than a whole-name match.