---
title: "Regex tester and explainer"
description: "Test JavaScript regex patterns locally with match positions, capture groups, explanations, and a hard ReDoS timeout."
---

> HTML: https://trendalyzer.app/tools/regex-tester/
> Index: https://trendalyzer.app/llms.txt

# Regex tester and explainer

A regular-expression tester evaluates a pattern against sample text and reports each match, its position, and captured groups. This implementation runs the expression inside a dedicated browser Worker with a hard cancellation deadline, so an expensive pattern cannot indefinitely freeze the interface. A compact explainer identifies common anchors, character classes, groups, and repetition tokens without pretending to provide a formal proof of what every possible JavaScript expression means.

Readiness: experimental

Input types: regular expression, sample text

Output types: matches, captured groups, syntax explanation

## Limits

- Patterns are limited to 500 characters
- samples to 100000 characters
- and execution to 250 ms.

## Warnings

- A successful sample does not prove a pattern is safe for untrusted production input.

## Worked example

Given: Order A-104 shipped

Result: Match Order A-104 with capture group A-104 when the pattern is Order ([A-Z]-\d+) and flags gi

## Steps

1. **Enter the pattern and flags** — Type a JavaScript regular expression and optional flags such as g or i in the dedicated fields.
2. **Paste sample text** — Provide the haystack you want to test — keep it under the sample size limit.
3. **Run and read matches** — Inspect match indexes, captured groups, and the plain-language token cues in the explainer panel.

## Read the result, not just the colour

Matches are returned as structured rows with indexes and captured groups. Example: with pattern `Order ([A-Z]-\d+)` and sample `Order A-104 shipped`, expect a match whose first capture is `A-104`.

## Production caution

The timeout protects this page. It does not certify the same expression under different input lengths or another regular-expression engine.

## FAQ



### Why can a regex time out?

Some nested repetitions trigger catastrophic backtracking. The Worker is terminated when it exceeds the local time budget.

### Does a green match mean the pattern is production-safe?

No. A successful sample only proves behaviour on that text. ReDoS risk and engine differences still need separate review.
