Contact, if you are interested in this website / domain name / Sponsorship / Advertisement / Partnership

Regex Tester

Test JavaScript regular expressions with live highlighting and groups.

Runs in your browserNo sign-upFree forever

Loading tool…

Report an issue

How to use the Regex Tester

  1. Enter a pattern and flags.
  2. Paste test text — matches highlight instantly.
  3. Optionally enter a replacement using $1 or $<name>.

About this tool

Regular expressions are a compact language for describing text patterns — validating emails, extracting IDs from logs, or rewriting thousands of lines at once. They're also notoriously easy to get subtly wrong, so testing against real samples before shipping is essential.

This tester uses your browser's native JavaScript regex engine, so behaviour matches Node.js and front-end code exactly. Matches are highlighted live; the panel below lists each match with its index and capture groups, or shows the full result of a replacement.

Flags cheat sheet

FlagEffect
gFind all matches (always on here)
iCase-insensitive
m^ and $ match at each line
s. also matches newlines
uUnicode mode (\p{L} etc.)

New to regex? Read our beginner's guide to regular expressions.

Frequently asked questions

Which regex flavor is this?

ECMAScript (JavaScript). Most syntax is shared with PCRE, Python and Java, but lookbehind and named-group syntax can differ slightly.

Why does my pattern hang?

Nested quantifiers like (a+)+ can cause catastrophic backtracking. Simplify the pattern.

How do I match a literal dot?

Escape it: \.

Get a free tech stack audit