RegexLens

Test regular expressions with live-highlighted matches.

100% client-side
/ /g

Test text

0 characters

Highlighted result

How regular expressions work

A regular expression (regex) describes a text pattern using a compact syntax: character classes, quantifiers and capture groups. The engine scans the test text looking for fragments that match that pattern:

Pattern: /(\w+)@(\w+\.\w+)/g
Text:    "Contacts: [email protected], [email protected]"
Match 1: "[email protected]"     group 1: "ada"   group 2: "lovelace.dev"
Match 2: "[email protected]"      group 1: "bob"   group 2: "example.com"

This tool uses JavaScript's native RegExp object with matchAll — no external libraries, no server calls.

Frequently asked questions

What regex engine does it use?

The browser's native JavaScript RegExp engine, the same one you'd use with .match() or .test() in your code — no conversion to another dialect (like PHP's PCRE or Python's).

What flags can I use?

g (global), i (case-insensitive), m (multiline), s (dot also matches newlines) and u (unicode) — toggled with checkboxes.

Does it show capture groups?

Yes, each match lists its numbered and named groups (if you use (?<name>...)) separately, with their exact text.

What happens if my regex has a syntax error?

It shows the exact error message the browser's engine returns, as soon as you stop typing.