UtilityToolsLab

© 2026 UtilityToolsLab. Built and maintained by the UtilityToolsLab Team.

About·Changelog·Privacy Policy·Terms of Service·Report a bug
HomeCode & DevRegex Tester

Related Tools

JSON FormatterBase64UUID GeneratorJWT DecoderTimestampRandom JSON GeneratorAPI Load TesterJSON Diff CheckerXML Formatter

Regex Tester & Explainer

Test regular expressions live with highlighted matches, capture groups, and a plain-English breakdown of every token. Includes replace preview and flag toggles.

You Might Also Like

All Code & Dev

Find & Replace

Find strings inside any text and replace them dynamically. Supports regex, case-sensitive, and replace-all modes.

JSON Formatter

Paste raw JSON to instantly format, beautify, validate and minify it. Syntax errors are pinpointed by line and column. Free and fully private.

Base64

Encode text or data to Base64 and decode Base64 strings back to readable text. A fast developer utility for API payloads, tokens and data URIs.

UUID Generator

Generate RFC 4122 compliant UUID v4 strings with one click, or batch-generate up to 100 unique IDs at once. Cryptographically random and free.

A regular expression that almost works is worse than one that plainly fails, because you ship it. The Regex Tester highlights every match inside your sample text as you type, breaks the pattern into labelled tokens, and lists each capture group by name and by number, so “it matched” becomes “it matched this, here, with these groups”.

All 6 JavaScript flags are individual toggles with a plain-English hint on each: g for every match, i for case, m to make anchors line-aware, s to let the dot cross newlines, u for Unicode code points, and y for sticky matching from the last index.

A replace panel sits below the matches, so you can check a substitution before running it anywhere destructive. Named groups work in the replacement string, which is what makes reordering a date a one-line operation. Everything runs against text in the page.

A Real Example: Reordering a Date

The tool opens on the pattern (?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})with a replacement of $<day>/$<month>/$<year>. Against a line listing three ISO dates it finds 3 matches, each with 3 named groups, and the replace preview rewrites every one into day-first order. Six more sample patterns are a click away, covering email addresses, URLs, hex colours, IPv4 addresses and the doubled-word check \b(\w+)\s+\1\b, which is the shortest useful demonstration of a backreference there is.

Limits and What Gets Truncated

  • Only the first 50,000 characters of your test text are matched, and a notice says so when the rest is being ignored. Highlighting a larger document interactively is what makes a tab stutter.
  • Matching stops after 2,000 hits with Stopped after 2,000 matches — narrow the pattern to see the rest. The count is still accurate up to that point.
  • Four stat cards report matches, unique matches, capture groups in the first match, and characters actually tested. Comparing the first two is the quickest way to spot a pattern matching the same token repeatedly.
  • An invalid pattern is reported with the engine's own message rather than a generic failure, and the previous highlighting is cleared rather than left stale.
  • A pattern that can match the empty string will not spin forever. The matcher advances past a zero-length match, which is the guard that keeps something like a* from hanging the page.
  • This is the JavaScript engine, not PCRE. Lookbehind is supported in current browsers, but atomic groups, possessive quantifiers and recursion are not, so a pattern lifted from PHP or Perl may need rewriting.
//g

Click to append a token:

Load sample pattern:

Matches

3

Unique

3

Groups

6

Chars Tested

60

Highlighted Matches
Released 2026-07-31, patched 2026-08-14, planned 2027-01-02.
Match Details
#12026-07-31index 9–19
$1 = "2026"$2 = "07"$3 = "31"year = "2026"month = "07"day = "31"
#22026-08-14index 29–39
$1 = "2026"$2 = "08"$3 = "14"year = "2026"month = "08"day = "14"
#32027-01-02index 49–59
$1 = "2027"$2 = "01"$3 = "02"year = "2027"month = "01"day = "02"
Replace
Pattern Explained
(?<year>Named capture group 1 — stored as "year"
\dAny digit (0–9)
{4}Repeat exactly 4 times
)End of the group
-Match the literal text "-"
(?<month>Named capture group 2 — stored as "month"
\dAny digit (0–9)
{2}Repeat exactly 2 times
)End of the group
-Match the literal text "-"
(?<day>Named capture group 3 — stored as "day"
\dAny digit (0–9)
{2}Repeat exactly 2 times
)End of the group