Regex Tester

Live JavaScript regex matching with groups, replace preview and a backtracking guard.

Runs locally · nothing uploaded
0 matches
Library
Test text

What it does

Type a pattern and every match is highlighted in the test text as you type. The Matches tab lists each match with its index, numbered capture groups and named groups (with their positions). Replace previews $1, $<name>, $& substitutions, and Code gives you ready-to-paste JavaScript and C# snippets.

  • Toggle flags g i m s u y, plus d and v when your browser supports them.
  • Click a pattern in the library (email, URL, GUID, IPv4, ISO date, semver, hex colour…) to start from a known-good regex.
  • Syntax errors show the engine’s message and, where it can be located, the position in the pattern.
  • Matching runs in a Web Worker with a time limit, so a pattern like (a+)+$ stops with a clear message instead of freezing the tab.

JavaScript vs .NET regex

  • Flags map to RegexOptions: i = IgnoreCase, m = Multiline, s = Singleline. There is no g in .NET: call Matches() instead of Match(). y, u and v have no direct option.
  • Named groups use (?<name>...) in both; .NET also accepts (?'name'...). In replacements JavaScript writes $<name>, .NET writes ${name}.
  • Lookbehind (?<=...) / (?<!...) works in both. .NET-only features include balancing groups, \A / \z anchors, inline (?x) options and RightToLeft.
  • \d matches any Unicode digit in .NET unless you pass RegexOptions.ECMAScript; in JavaScript it is always [0-9].

Privacy

Your pattern and text stay in your browser and are saved only in local storage so a refresh keeps your work.