Regular Expression Tester & Debugger

Test JavaScript regular expressions with real-time match highlighting, capture groups, and flag controls.

Runs locally 0 lines • 0 bytes
Awaiting match
Results update as you type
Input
Paste or type
Result
Updates as you type
// Converted text will appear here...
About this tool

About the Regex Tester

Test and debug JavaScript regular expressions in real time. Highlight matches, inspect capture groups and check regex syntax. Nothing is sent.

How to use the Regex Tester

  1. Enter your regular expression and flags such as g, i or m.
  2. Paste test text and watch matches highlight as you type.
  3. Inspect the capture groups, then copy the pattern into your code.

Regex Tester example

Input
Pattern: \d{4}-\d{2}-\d{2}   Flags: g
Text: Shipped 2026-03-14, patched 2026-03-18
Result
2 matches: 2026-03-14, 2026-03-18

When to use it

  • Building form validation patterns for phone numbers, dates and postcodes.
  • Extracting IDs, URLs or error codes from logs.
  • Testing search-and-replace patterns before running them across a codebase.

Tip: Patterns run with the JavaScript regex engine, so syntax such as lookbehind and named groups works exactly as in Node.js and modern browsers.

Real-Time Match Highlights

Every match is highlighted inside your test text as you type.

Capture Group Breakdown

Lists each match with its index range, numbered groups and named groups.

All JavaScript Flags

Use g, i, m, s, u, y and d flags; invalid or duplicate flags are ignored safely.

Syntax Error Diagnostics

Reports unescaped parentheses, invalid ranges and quantifier errors as you type.

FAQ

Common questions

Which regular expression dialect is supported?

Standard ECMAScript / JavaScript RegExp syntax with full modern support (named groups, unicode, lookaheads, lookbehinds).

What do regex flags like g, i, and m do?

g finds all matches (global), i ignores letter casing, and m treats ^ and $ as start and end of each line.

Can I copy the matches?

Yes. Copy output gives the full match list with positions and groups; Download saves it as a text file.

Does testing regex send my test data to a server?

Never. All RegExp execution runs 100% inside your browser environment.