Home/Regex Tools/Regex tester & explainer

Regex tester & explainer

Regex Tester and Explanation Tool

JavaScript regular expressions only. Everything runs locally in your browser.

0 matches Valid regex
PatternNo slashes needed (enter the pattern only)

Performance (estimate)

Run time

Text

106 chars

Matches

0

Flags

giu

Enter a valid pattern and some text to measure.

FlagsToggle options

Active: giu

Tip: use g to see all matches; remove it to see just the first.

Test textPaste data or type freely
Highlighted matchesVisual preview
Contact: [email protected] Support: [email protected] Invalid: not-an-email@ Upper: [email protected]
MatchesIncludes capture groups
No matches found.

Max 500 matches rendered to keep things fast.

Regex explanationHuman-readable breakdown

Finds all matches. Looks for a match inside the input using JavaScript regex.

gGlobaliIgnore caseuUnicode

Breakdown

(?<user>
Named capturing group “user”.
[a-z0-9._%+-]
Character class (match one char from the set).
+
Repeat 1 or more times.
)
End of group.
@
Literal character.
(?<domain>
Named capturing group “domain”.
[a-z0-9.-]
Character class (match one char from the set).
+
Repeat 1 or more times.
\.
Escaped literal “.”.
[a-z]
Character class (match one char from the set).
{2,}
Exactly 2 times.
)
End of group.

Quick tips

  • Use ^ and $ to validate the whole string.
  • Turn on g to see every match in the text.
  • Prefer [\\s\\S] if you need “any character” without relying on dotAll.

Common recipes

  • \\d+ — one or more digits
  • \\b\\w+\\b — whole words
  • ^\\S+$ — non-empty, no spaces
  • ^(a+)+$ — slow example (backtracking)

Privacy & engine

This tool runs entirely in your browser using the JavaScript regex engine. Your text and patterns are not sent to a server.

If you’re comparing against PCRE/.NET/RE2, behavior can differ (especially around lookbehinds, Unicode, and backtracking).

How it works

The tester compiles your pattern with the JS RegExp engine, runs it in a web worker, and streams matches plus a plain-language breakdown of each token.

  • Highlights, groups, flags, and JSON output come from the same run so they stay in sync.
  • Unsupported flags are disabled automatically; sticky and indices depend on your browser engine.

Quick examples

Hex color tokens
#[0-9A-Fa-f]{6}
#1e90ff
Capture ISO dates
(?<date>\\d{4}-\\d{2}-\\d{2})
date:2024-11-05

Use lazy quantifiers like *? to keep matches tight when text is long.

Mini FAQ

Does it support lookbehind?

Yes in modern browsers; older ones may fail to compile patterns with ?<= or ?<!.

Why do matches stop?

Rendering caps at 500 results to keep the UI responsive.

How do ^ and $ behave?

Without m they anchor the whole text; with m they anchor each line.