KitJade
Developer ToolsRuns in your browser

Regex Tester

Live regex matching, groups and replace preview.

Use the Regex Tester tool

Runs in your browserUpdated Report a problem

What this regex tester does

Regex Tester evaluates a JavaScript regular expression against sample text and highlights every match as you type. Each match lists its capture groups and named groups, and a replace preview shows the result of using $1 or $<name> references.

Catastrophic backtracking can hang a browser tab. This tester runs matching inside a Web Worker and cancels the job after a short time limit, so a pathological pattern produces an error instead of a frozen page.

Why use it

  • Build and debug validation patterns before adding them to application code.
  • See exactly which capture groups a pattern produces.
  • Check the effect of the global, multiline, dotAll, unicode and sticky flags.

How to use it

  1. 1Enter a pattern without the surrounding slashes.
  2. 2Change flags using the toggle buttons.
  3. 3Type or paste the test text and review highlighted matches.
  4. 4Optionally enter a replacement string to preview the transformed text.

Worked examples

Find ISO dates

Input

Pattern: \b\d{4}-\d{2}-\d{2}\b · Text: shipped 2026-11-08, due 2026-12-01

Output

2 matches: 2026-11-08, 2026-12-01

Extract key/value pairs

Input

Pattern: (\w+)=(\w+) · Text: id=42 role=admin

Output

Match 1 → $1: id, $2: 42 · Match 2 → $1: role, $2: admin

Common mistakes

  • Forgetting that JavaScript regex has no \A or \Z anchors — use ^ and $ with the multiline flag carefully.
  • Using a global regex with .test() in a loop without resetting lastIndex.
  • Validating email addresses with an enormous pattern instead of a simple check plus a verification email.

Frequently asked questions

Which regex flavour is used?
JavaScript (ECMAScript) regular expressions, as executed by your browser. Syntax and behaviour differ from PCRE, Python and Java in some details.
Why did my pattern time out?
Nested quantifiers such as (a+)+ can explode combinatorially on long input. Rewrite the pattern to be more specific, or anchor it.
Are named groups supported?
Yes. Patterns such as (?<year>\d{4}) are shown separately in the group list.
All tools