Developer utility

Regex Live Tester and Cheat Sheet

Build JavaScript regular expressions, highlight matches, inspect capture groups, and preview replacements without sending text to a server.

Runtime
Browser
Engine
JS
Mode
Live

Expression tester

Uses the browser JavaScript RegExp engine.

No uploads
/ /g
0 chars
0 chars
 

Regex compiled.

Highlighted text

Matches are highlighted in source order.

0 matches
 

Match table

Capture groups are listed as JSON arrays or named objects.

Limit 100
# Index Match Groups

Global matching

The global flag finds repeated matches. Without it, JavaScript returns only the first match from the input.

Capture groups

Parentheses capture submatches for extraction and replacement. Named groups make larger expressions easier to read.

Replacement tokens

JavaScript replacements can use tokens like $& for the full match, $1 for a capture, and $<name> for a named capture.

Usage guide

How to use the regex tester

What this tool shows

It compiles JavaScript regular expressions, highlights matches, lists indexes and capture groups, and previews replacement output.

How to test it

Edit the pattern, toggle flags, paste sample text, and use named groups to confirm exactly what your expression captures.

When it helps

Use it for log parsing, form validation, search patterns, replacement rules, or learning how anchors, groups, and quantifiers behave.