Text & Data

Regex Generator & Tester

Write a regular expression and instantly see every match highlighted in your test string, with capture groups and named groups broken out. Toggle flags (g, i, m, s, u, y) and load ready-made patterns for email, URL, IPv4, dates and more — all run locally in your browser.

Pattern
//g
Common patterns
Test string
Matches highlighted

Enter a pattern and a test string to see matches.

About this tool

Regular expressions are powerful but unforgiving — one misplaced quantifier and your pattern matches nothing, or everything. This regex tester gives you a live feedback loop: type a pattern, paste a test string, and every match lights up instantly, with capture groups and named groups pulled out so you can see exactly what the expression grabbed.

It also lowers the barrier for people who do not write regex daily. Toggle the flags that change matching behaviour (global, case-insensitive, multiline, dotall, unicode, sticky), and load battle-tested patterns for email, URL, IPv4 and dates as a starting point. Because it uses the browser's own regex engine, the behaviour matches JavaScript exactly.

How to use

  1. Type or paste your regular expression into the pattern field.
  2. Paste the text you want to test against into the test string area.
  3. Watch matches highlight in real time as you refine the pattern.
  4. Toggle flags like g, i, m, s, u, and y to change how matching behaves.
  5. Inspect the extracted capture groups and named groups below the matches.
  6. Load a ready-made pattern for email, URL, IPv4 or dates if you need a head start.

Features

  • Live match highlighting that updates as you type.
  • Capture groups and named groups broken out per match.
  • Full flag support: global, ignore-case, multiline, dotall, unicode and sticky.
  • Built-in starter patterns for common needs like email, URL, IPv4 and dates.
  • Uses the browser's native engine, so results mirror JavaScript regex exactly.
  • Immediate feedback on invalid patterns instead of silent failure.
  • Runs completely client-side — your test data never leaves the page.

Frequently asked questions

Is my test data or pattern sent to a server?

No. Matching is performed with the browser's built-in RegExp engine in JavaScript. Your pattern and test string stay entirely in the page and are never transmitted.

Which regex flavour does it use?

It uses the JavaScript (ECMAScript) engine that ships with your browser. Syntax and behaviour match what you would get from RegExp in Node.js or front-end code, which is not identical to PCRE, Java, or Python regex.

What does the g (global) flag change?

Without the global flag only the first match is found. With it, every non-overlapping match in the string is returned, which is what you usually want when highlighting all matches.

How do named groups appear?

If your pattern uses named capture groups like (?<year>\d{4}), each match lists those names alongside their captured values, making it easy to confirm the right part was captured.

Why does the dot in my pattern not match newlines?

By default the dot matches any character except a line break. Enable the s (dotall) flag to make it match newlines too, which is often needed when testing against multi-line input.