Regex & .gitignore Glob Pattern Live Tester
Test JavaScript RegExp capture groups and flags OR validate multi-line .gitignore / file glob rules (**, *, !negation) against real paths locally.
Input & Options
Local JS Execution
Parsed Output & Diagnostics
Ready
Status
...
Generated Output
Glob vs. RegExp Quick Reference
| Syntax | Behavior | Example |
|---|---|---|
| **/ | Zero or more nested directories | **/cache/*.json |
| * | Matches single path segment (no /) | *.log -> error.log |
| !rule | Re-includes previously excluded path | !dist/README.md |
| (?<name>...) | ES2018+ Named capture group | (?<port>\d{2,5}) |
Parser Methodology & Privacy Guarantees
Executes standard ECMAScript RegExp with zero-length match loop protection, or compiles `.gitignore`-style ordered rules sequentially with negation (`!`) override tracking.
- Checks RegExp compilation errors immediately and guards against infinite zero-width global matches.
- Extracts full matches, numbered capture groups, named groups (`(?<name>...)`), and character indices.
- In Glob mode, applies rules top-to-bottom so later `!negation` lines accurately override earlier exclusions.
Scope & limitations: Pathologically catastrophic backtracking regexes entered directly are evaluated by your browser JS engine; avoid untrusted nested quantifiers like (a+)+.
Frequently Asked Questions
Why does !dist/keep.txt fail if dist/ ignores the parent directory in real Git?
Git skips scanning inside ignored directories unless the parent path itself is un-ignored. At the file-rule evaluation level, later matching !rules override earlier exclusions.
What regex dialect does this tester use?
Native ECMAScript (V8/JavaScript) RegExp, supporting lookbehinds, Unicode property escapes (\p{...}), and named capture groups.
Are my log samples sent to any server while testing regexes?
No. Evaluation happens inside browser memory on every keystroke.