DevToolbox

Regex Tester

Test regular expressions with live matches, groups, and highlighting.

Processed locally in your browser
//g
Regex flags

Test String

Matches (0)

Enter a pattern and test string to see matches highlighted here.

Common Regex Examples

What is the Regex Tester?

The Regex Tester lets you write a regular expression, toggle flags, and instantly see every match in your test text — with highlighted matches, positions, capture groups, and named groups. It uses JavaScript's native RegExp engine, so behavior matches exactly what your Node.js or browser code will do.

Regular expressions are indispensable for validation, extraction, and text transformation, but subtle syntax differences make them hard to write blind. Testing patterns against real sample text with immediate visual feedback is the fastest way to get them right.

How to use the Regex Tester

  1. Type your pattern in the regex field (without surrounding slashes).
  2. Toggle flags: g (global), i (ignore case), m (multiline), s (dotall), u (unicode), y (sticky).
  3. Paste sample text in the test string editor — matches highlight instantly.
  4. Inspect the match list for positions, capture groups, and named groups.
  5. Load a common pattern (email, URL, dates…) with one click to start from a working example.

Examples

Extract ISO dates with named groups

(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})

Case-insensitive word match

\berror\b  with flags: gi

Frequently asked questions

Which regex flavor is used?

JavaScript (ECMAScript) — the engine built into your browser. Patterns behave identically in Node.js and browser code. PCRE-specific syntax like possessive quantifiers isn't supported.

Why does my pattern match only once?

Without the g (global) flag, JavaScript regexes stop after the first match. Enable g to find all matches.

Is my test data uploaded anywhere?

No. Matching runs entirely in your browser, so you can safely test against logs or data samples.

What happens with catastrophic backtracking?

Pathological patterns on long inputs can freeze any regex engine, including the browser's. If the page becomes unresponsive, simplify the pattern or shorten the test text.