Match coverage
Match details
| # | Match | Range | Groups |
|---|
Transformed text
Execution is stopped after 800 ms, output is capped at 2,000 matches, and test text is limited to 500,000 characters to protect browser responsiveness.
Build patterns from small, testable pieces
Start with literal text, add character classes and boundaries, then introduce repetition and groups. Test both expected matches and text that must not match.
Choose allowed characters
\d matches digits, \s whitespace, and [A-Z] an ASCII uppercase range.
Control repetition
*, +, ?, and {n,m} control how many times a token may repeat.
Capture useful parts
Use (...) or (?<name>...); use (?:...) when capture is unnecessary.
Constrain context
^ and $ anchor lines or input. \b identifies an ASCII-style word boundary.
Avoid catastrophic backtracking
Nested ambiguous repetition—such as repeated groups that can match the same characters in many ways—can make backtracking engines take exponential time. Prefer specific character classes, bounded quantifiers, and unambiguous alternatives. The timeout protects this page, but production code still needs carefully reviewed patterns.
Frequently asked questions
Which regular-expression flavor does this use?
Your browser’s JavaScript RegExp engine. Features can vary slightly with browser support, especially newer flags.
Why is the global flag important?
Without g, JavaScript stops after the first match. This tester respects that behavior and reports one match unless global matching is enabled.
What replacement tokens are supported?
JavaScript supports tokens including $& for the entire match, $1 for numbered groups, and $<name> for named groups.
Why did my test time out?
The pattern likely required excessive backtracking for the supplied text. Simplify ambiguous nested quantifiers or reduce the test case.