Regex Tester

Test regular expressions with live highlighting and a capture group inspector.

/ /

Enter a pattern to begin.


Matches
Matches will be highlighted here.
Capture groups
Replacement result
,

Common patternsClick to load

Features

  • Live match highlighting as you type
  • Numbered and named capture group inspector
  • All standard flags with one-click toggles
  • Replacement preview with $1 backreferences
  • Library of twelve common patterns

How to use it

  1. Type your pattern in the top field.
  2. Paste sample text into the box below.
  3. Matches highlight immediately; groups appear in the table.
  4. Add a replacement string to preview a substitution.

Flags, greediness and catastrophic backtracking

The flags change behaviour more than newcomers expect. Without g, only the first match is returned. The m flag makes ^ and $ match at line boundaries rather than only at the start and end of the whole string. The s flag lets . match newlines, which it otherwise never does, the single most common reason a pattern fails on multi-line input.

Quantifiers are greedy by default, meaning <.+> against <a><b> matches the entire string rather than just <a>. Adding ? makes them lazy, so <.+?> stops at the first closing bracket. Knowing which you want is usually the difference between a pattern that works and one that almost works.

The genuine hazard is catastrophic backtracking. Nested quantifiers such as (a+)+b can take exponential time on input that nearly matches, a few dozen characters can hang the engine for minutes. This has taken down production services; Cloudflare's 2019 global outage was caused by exactly this. If a pattern will ever see untrusted input, avoid nesting quantifiers, and prefer atomic constructs or a hard input length limit. This tool caps execution to keep the tab responsive if you hit one.

Frequently asked questions

Yes, completely. Regex Tester is free with no usage limits, no account and no sign-up. There is no paid tier and no trial that expires. Tools marked Premium on this site carry that label to indicate a deeper feature set, not a price.
Regex Tester covers live match highlighting as you type, numbered and named capture group inspector, all standard flags with one-click toggles, among other things. Everything is available immediately with no account, no sign-up and no usage limit.
The flags change behaviour more than newcomers expect. Without g, only the first match is returned. The m flag makes ^ and $ match at line boundaries rather than only at the start and end of the whole string. The s flag lets . match newlines, which it otherwise never does, the single most common reason a pattern fails on multi-line input.
Everything is processed in your browser. Code, tokens and payloads you paste in never leave your device, which matters when you are debugging something that contains real credentials or customer data. Check the Network tab if you want to confirm it. Because nothing depends on a server, the tool also keeps working offline once the page has loaded, the site registers a service worker that caches it after your first visit.

Related tools

Further reading

📖 How to Test Regular Expressions Without Breaking Them

Read the full guide on the 123MiniApps blog.

Pick a theme

Ten hand-tuned palettes.