Regex Tester

Test JavaScript regular expressions with live capture group previews

Type a pattern and immediately see match count, index, length, capture groups, named groups, and replacement output. It is designed for quick iteration while writing log parsers, validation rules, and routing patterns.

When this tool helps

Regular expressions power log filtering, form validation, data cleanup, and routing rules across both frontend and backend stacks. The pain point is usually verification: you want to know whether the pattern actually matches every variation and pulls the right capture groups.

This page keeps the loop tight. As you edit the pattern, flags, or test string, the match list, indices, and capture groups update instantly. Add a replacement string and you can preview how `$1`, `$&`, and `$<name>` backreferences behave without switching to a REPL.

Supported flags

  • g — global search, match across the whole string.
  • i — ignore case for both ASCII and Unicode letters.
  • m — multiline: `^` and `$` anchor to each line.
  • s — dotAll: `.` also matches newline characters.
  • u — Unicode mode with surrogate pairs and property escapes.
  • y — sticky matching from the current `lastIndex`.

Handy pattern examples

Basic email

^[\w.+-]+@[\w-]+\.[\w.-]+$

ISO 8601 date with named groups

(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})

North American phone number

^\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$

Frequently asked

Q. Does this accept Python or PCRE syntax? No — only JavaScript RegExp syntax is supported, so lookbehind and Unicode property escapes require recent browsers.

Q. What happens with thousands of matches? To protect the browser we cap at 1,000 matches. Narrow the pattern with anchors before streaming large logs through it.

Q. Is my test data sent to a server? No, the entire evaluation happens inside the browser.

Pairs well with

Jump to other JSON2Class utilities that naturally follow this one.

JSON to Java

Generate Java DTOs and review validation-oriented API models.

JSON to Kotlin

Review nullability and Kotlin data class structure quickly.

JSON Formatter

Format sample payloads before sending them back into the converter.