About the Regex Tester
The JavaScript regex tester runs a pattern against sample text and displays matches, capture groups, and indexes. It uses the browser's regular-expression engine, so results correspond to JavaScript syntax and supported flags.
How to use this tool
Enter a pattern without surrounding slash delimiters, choose flags, add sample text, and run the test. Use g to collect multiple matches, i for case-insensitive matching, m to change line-anchor behavior, s to let dot match line terminators, u for Unicode-aware parsing, and y for sticky matching from the current position. Reduce a failing expression to the smallest representative input before adding optional branches or nested quantifiers.
How to read the result
Each match includes the complete matched substring and its start index. Parentheses create numbered capture groups unless they are non-capturing, and named groups expose a keyed result. With the global flag, the engine continues after each match. Anchors, character classes, greediness, lookarounds, and Unicode behavior depend on the chosen flags and JavaScript semantics, which can differ from PCRE, .NET, Python, RE2, or command-line tools.
Limits and privacy
The tester does not prove that a pattern is safe for untrusted or very large input. Backtracking expressions can consume excessive CPU and create denial-of-service risk even when they work on short samples. Regex is also a poor fit for parsing many nested grammars. Testing and sample text remain in the browser, and the tool does not submit them to buffer.lol.
Common questions
- Why does this regex behave differently from another tester?
- Regex dialects differ. This tool uses JavaScript's RegExp syntax, features, Unicode rules, and flag behavior.
- What does the global flag change?
- The g flag asks JavaScript to find successive matches instead of stopping after the first one.