CODDY Tool

Regex Tester

Test regular expressions with live match highlighting and capture groups.

Write a pattern and see exactly what it matches, highlighted in your test string. Inspect numbered and named capture groups, preview replacements, and start from a library of patterns that already work.

Everything you enter stays in this browser tab. Nothing is sent to our servers, logged or stored.

Loading tool…

What Regex Tester supports

Test

  • Test & highlight matches
  • Replace
  • Inspect capture groups

Learn

  • Common pattern library
  • Syntax reference

About Regex Tester

Regular expressions are written by trial and error even by people who know them well, and the loop of edit, run, squint at the output is far faster when the matches are highlighted in place. Every match is numbered, and its capture groups are listed underneath, so you can see immediately whether group 2 is picking up what you think it is.

The replace preview matters as much as the match view. A pattern that matches correctly can still produce the wrong output once $1 and $<name> references are involved, and seeing the result before running it against real data saves a lot of grief.

One warning the tool gives that most do not: catastrophic backtracking. A pattern like (a+)+$ can take exponential time on a non-matching string, and JavaScript offers no way to interrupt a running regex — the tab simply freezes. Patterns with that shape are flagged before you run them, and the input length is capped.

How to test a regular expression

  1. Enter your pattern

    Type it directly, or load one from the library as a starting point.

  2. Set the flags

    Global for every match, ignore case, multiline for ^ and $ at each line break.

  3. Paste a test string

    Matches are highlighted as you type, with each one numbered.

  4. Check the groups

    Expand any match to see its numbered and named capture groups.

The flags, and what they actually do

  • g (global) — find every match rather than stopping at the first.
  • i (ignore case) — match regardless of capitalisation.
  • m (multiline) — ^ and $ match at each line break instead of only at the ends of the string.
  • s (dotall) — let . match newline characters too.
  • u (unicode) — enable \p{...} property escapes and correct handling of characters outside the BMP.
  • y (sticky) — match only from the position where the last match ended.

Catastrophic backtracking

Some patterns take exponential time on inputs that do not match. The classic shape is a repeated group whose contents are themselves repeated — (a+)+ — where the engine has an enormous number of ways to split the input before it can conclude there is no match.

This matters more in a browser than almost anywhere else, because a running regular expression cannot be interrupted: the tab freezes until it finishes, which may be never. Rewriting the pattern to remove the nested quantifier is almost always possible and always the right fix.

Frequently asked questions

Which regex flavour does this use?

JavaScript's, since it runs in your browser. That is very close to PCRE for everyday patterns, but there are differences: JavaScript has no atomic groups or possessive quantifiers, and lookbehind requires a reasonably recent browser.

What is the difference between a numbered and a named group?

Both capture part of a match. A numbered group is written (…) and referenced as $1; a named group is written (?<name>…) and referenced as $<name>. Named groups make a complex pattern far easier to read and survive being reordered.

Why does the tool warn about my pattern?

It has a shape known to cause catastrophic backtracking — usually a repeated group containing another repetition. On some inputs that takes exponential time, and a running regular expression cannot be cancelled, so the tab would freeze.

Is there a limit on the test string?

Yes, 200,000 characters, and matches are capped at 1,000. Both limits exist because a slow pattern on a long string cannot be interrupted once it starts.

Can I use this to parse HTML?

For extracting something from markup you control, yes. For parsing arbitrary HTML, no — nested tags and edge cases defeat regular expressions comprehensively. Use a DOM parser instead.

All Developer Tools

Regex Tester is free to use with no account, no watermark and no usage limits. Last updated 14 August 2026.