Regex Tester

Test regular expressions
This free online regex tester runs in your browser and is part of our Developer Tools collection.

Regex Tester

Test and debug regular expressions with real-time matching and highlighting.

Quick Reference:

  • \d - Any digit (0-9)
  • \w - Word character (a-z, A-Z, 0-9, _)
  • \s - Whitespace character
  • . - Any character except newline
  • + - One or more
  • * - Zero or more
  • ? - Zero or one
  • {n,m} - Between n and m times
  • ^ - Start of string
  • $ - End of string
⚡
Instant In-Browser Execution Runs locally in JavaScript without wait times or server delays.
🔒
100% Privacy & Security Your inputs and files are never stored or logged on remote servers.
📱
Cross-Device Responsive Fully optimized for mobile smartphones, tablets, and desktop displays.
🎉
100% Free Forever No subscription fees, no signups, and no software installations.

How to Use the Online Regex Tester

1 Enter Regular Expression Pattern

Type your regex pattern in the expression box (e.g. `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`).

2 Toggle Regex Flags

Select modifier flags: Global (`g`), Case-Insensitive (`i`), Multiline (`m`), DotAll (`s`), or Unicode (`u`).

3 Input Test Strings

Paste sample log lines, emails, or text to evaluate into the test area.

4 Inspect Real-Time Highlighting & Groups

Matches highlight with alternating colors in real time; captured groups ($1, $2) and index offsets appear in the match details table.

Frequently Asked Questions

Common questions about using this free online regex tester.

What does each regular expression flag do? ▾
`g` (global) finds all matches instead of stopping at the first; `i` ignores case; `m` treats `^` and `$` as start/end of each line; `s` allows `.` to match newlines; `u` enables full Unicode code point handling.
How are capture groups and named capture groups displayed? ▾
Every numbered capture group `(...)` and named capture group `(?<name>...)` is broken down in the interactive sidebar table, displaying its captured string and character start/end index.
Can this tester handle lookaheads and lookbehinds? ▾
Yes. The JavaScript RegExp engine natively supports positive/negative lookaheads (`(?=...)`, `(?!...)`) and lookbehinds (`(?<=...)`, `(?<!...)`).
Is there a built-in regex cheat sheet? ▾
Yes. Click the "Cheat Sheet" drawer to review common character classes (`\d`, `\w`, `\s`), quantifiers (`*`, `+`, `?`, `{n,m}`), and anchors.

More Developer Tools

Explore related tools in the same category to solve adjacent tasks faster.

JSON FormatterFormat and validate JSONHTML Encoder/DecoderEncode and decode HTML entitiesCode MinifierMinify CSS, JS, and HTMLCode BeautifierBeautify CSS, JS, and HTMLSQL FormatterFormat SQL queries