https://shadtools.comCapture groups
- $1
- https
- $2
- shadtools.com
Named groups
- protocol
- https
- host
- shadtools.com
Test JavaScript regular expressions against sample text and inspect captures and named groups.
https://shadtools.comhttp://localhost:4321Patterns run with the browser's JavaScript regular expression engine. Avoid untrusted patterns that can cause excessive backtracking.
Enter the pattern without surrounding slash delimiters, add JavaScript flags such as g, i, or m, and paste representative input. The match panel reports the full match, its zero-based index, numbered capture groups, and named groups.
g finds every match instead of stopping after the first.i performs case-insensitive matching.m changes ^ and $ to work at line boundaries.s allows dot to match newline characters.u enables Unicode-aware pattern behavior.y requires the next match to begin exactly at the current index.Use small, representative examples while developing a pattern, then test edge cases and non-matching input before using it in production.
It uses the JavaScript RegExp engine built into your browser, including supported flags and named capture groups. Behavior can differ from PCRE, Python, Java, or .NET regex engines.
The global flag asks the engine to continue after the first match. Without g or the sticky y flag, the tester reports only the first match.
Some patterns can trigger catastrophic backtracking on certain inputs. The tool limits pattern and input size, but JavaScript cannot safely interrupt every expensive synchronous regex, so only run patterns you trust.