JavaScript Regex Tester
Try a regular-expression pattern against sample text and inspect every matched value and starting position.
What is this tool?
The tester compiles a JavaScript regular expression and applies it to your text. It lists complete matches, capture groups when present, and zero-based character indexes.
How to use
- Enter a pattern without slash delimiters.
- Select the flags your pattern needs.
- Paste test text.
- Run the test and review match positions.
Example
\d+ matches each run of digits, while the i flag makes letter matching case-insensitive.
FAQ
Which regex flavor is used?
Your browser's JavaScript regular-expression engine.
Why is global matching always shown?
The tester finds every occurrence so it can report a useful match count; your selected flags otherwise stay intact.
Can a pattern freeze the page?
Some pathological patterns can cause heavy backtracking. Test untrusted or complex expressions with care.