What does the JavaScript Regex Tester check?
The KitLumi JavaScript Regex Tester compiles a pattern with the browser RegExp engine, scans the supplied text, and exposes each match and capture group. The tester does not emulate PCRE or server-side regex engines.
How do you test a regular expression?
- Enter the pattern without surrounding slash characters.
- Set JavaScript flags such as
g,i,m,s, oru, then paste test text. - Read highlighted matches and inspect the match index and capture groups in the table.
What do common JavaScript regex flags mean?
| Flag | Meaning | Use it when |
|---|---|---|
| g | Global search | You need every match |
| i | Case-insensitive | Letter case should not matter |
| m | Multiline anchors | ^ and $ should match lines |
| s | Dot matches newlines | A match may span lines |
| u | Unicode mode | You use Unicode-aware escapes or code points |
What does a timeout mean?
A timeout means the browser did not finish the search within 300 ms. Nested quantifiers and ambiguous repeated groups are common causes. Reduce the input, make repetitions more specific, or replace a broad pattern with a parser.
Frequently asked questions about Regex Tester
Which regex engine does this tester use?
The Regex Tester uses the JavaScript RegExp engine in your browser. PCRE, Python, .NET, and Java expressions can behave differently.
Does the Regex Tester show capture groups?
Yes. The result table shows numbered captures and named groups for the first 100 displayed matches.
How does the tester handle slow regular expressions?
Each test runs in a Web Worker and is terminated after 300 milliseconds. The timeout reduces page freezes but is not a formal proof that a pattern is safe.
Why is a valid regex rejected?
The pattern may use syntax that JavaScript does not support, or a flag may not be available in the current browser. Check the target runtime before shipping the expression.
What changed?
Added JavaScript pattern testing, flag validation, highlighted previews, capture-group output, a 1,000-match cap, and worker termination for slow patterns.