Skip to content
OmniTools

Regular Expression Tester

Test JavaScript regular expressions with live match highlighting and capture group breakdown.

All developer tools

Regular expression tester

2 matches

  1. at 8: 2026-09-26

    $1=2026 $2=09 $3=26

  2. at 33: 2026-10-15

    $1=2026 $2=10 $3=15

This compiles with the JavaScript engine, so what you see is what your runtime will do. Patterns are not portable to Python, Java, or PCRE without changes.

Result of replacing all matches

This tool runs entirely in your browser. Nothing you enter is uploaded, stored, or logged.

What this tool does

A regular expression is compact and unforgiving, which makes it hard to develop by reading alone. This tester runs your pattern against sample text as you type, highlights every match, breaks out what each capture group captured, and reports the exact position and error when a pattern will not compile.

How it works

The pattern is compiled with the same engine your runtime uses, so what you see here is what JavaScript will do. There is no approximation and no translation, which is the main trap with online regex testers: Python, Java, and JavaScript disagree about named groups, unicode handling, and escaping, so a pattern that works in one frequently fails in another.

Every match is reported with its index, the matched substring, and the contents of each capturing group. Named groups are labelled. This is what you actually need when a pattern matches but returns the wrong value, which is nearly always a grouping problem rather than a matching problem.

Zero-width assertions such as lookaheads and lookbehinds and word boundaries match positions rather than characters, so they produce no visible highlight in the text. They still appear in the match list, and the tool flags them so a pattern that appears to match nothing is not mistaken for a broken pattern.

Worked example

Extracting a year, a two-digit month, and a day from a date string.

  1. Pattern: (\d{4})-(\d{2})-(\d{2})
  2. Group 1 = 2026, group 2 = 09, group 3 = 26
  3. Matched text = 2026-09-26

Three capture groups holding the year, month, and day, with the full match spanning the entire string.

Accuracy and limitations

  • This tests JavaScript regular expressions only. Patterns are not portable to Python, Java, Go, or PCRE without changes.
  • A pattern that matches very large inputs can block the browser's main thread. Keep the test text small.
  • Lookarounds are supported in modern JavaScript but not in older environments, so check your runtime target.

Frequently asked questions

Why does my pattern match nothing?
The most common causes are unescaped literal characters such as . or +, a missing anchor where you expected one, and a case mismatch. The error panel reports the position and character when the pattern will not compile, and any zero-width matches are listed even though they highlight nothing.
What is the difference between .* and .+?
The quantifier. . matches any character except a newline, .* allows zero or more of them, and .+ requires at least one. This is the classic cause of a pattern that matches an empty string: use .+ when at least one character is required.
How do I match across multiple lines?
The dot does not match a newline by default. Use the s flag for dotAll, or enable the m flag so ^ and $ match at the start and end of each line rather than the whole string. A 0x0A in the match list is a newline character.
Is my pattern sent anywhere?
No. It is compiled and tested in your browser, so pasting a pattern containing internal identifiers is safe from this tool's perspective.