Skip to main content
${format:vault}

Regex Tester

//
Test string
Match results
Enter a pattern above…

Why use a private Regex tester?

Testing regular expressions against real data often means pasting log lines, API responses, or user records into a form field on a third-party site. That data sits in someone else's server logs. For patterns that validate email addresses, parse auth tokens, or extract fields from PII-containing logs, that's an unnecessary risk.

formatvault's regex tester runs entirely in your browser using JavaScript's built-in RegExp engine. You can test against any text without it ever leaving your machine.

How it works

Patterns are compiled with JavaScript's RegExp constructor as you type. Each match is extracted with matchAll, which returns the full match, all capture groups (named and positional), and — with the d flag — the start/end index of each group. The test string is sanitized with DOMPurify before being highlighted in the output panel.

All six JS flags are supported: g (global), i (case-insensitive), m (multiline), s (dot-all), u (Unicode), and d (hasIndices).

Common use cases

  • Extracting fields from structured log lines (timestamps, levels, request IDs) without uploading logs
  • Validating email, phone, or postal code patterns against real user data during development
  • Testing URL routing patterns before deploying to Express, Nginx, or React Router
  • Parsing CSV-like text with irregular delimiters or quoted fields
  • Writing named capture groups to extract labelled data (e.g. (?<year>\d{4})) and verifying output
  • Debugging why a pattern matches in one context but not another by toggling flags live
  • Learning regex — seeing every match, group, and index position in real time accelerates understanding

Frequently asked questions

Which regex flags are supported?
All six JavaScript RegExp flags: g (global — find all matches), i (case-insensitive), m (multiline — ^ and $ match line boundaries), s (dot-all — . matches newlines), u (Unicode — enables full Unicode category support), and d (hasIndices — exposes per-match start/end index ranges).
Are named capture groups supported?
Yes. Named groups using the (?<name>...) syntax are displayed per-match in the results panel alongside positional groups. This follows the ECMAScript 2018 named groups specification and works in all modern browsers.
Is it safe to test patterns against sensitive log data here?
Yes. The regex engine is JavaScript's built-in RegExp — no data leaves your browser. You can safely paste API responses, log lines, or PII-containing text and verify zero outbound requests in DevTools → Network.
Why does my pattern match differently here than in Python or Go?
This tester uses JavaScript's RegExp engine, which differs from Python's re module and Go's regexp package. Lookaheads and lookbehinds work, but possessive quantifiers and atomic groups are not supported. Use the u flag to enable standard Unicode behaviour.
What does the d flag (hasIndices) do?
The d flag adds an .indices property to each match, exposing the start and end character positions of each capture group as well as the full match. The results panel shows these as index ranges (e.g. 4–12) next to each match.

Related tools