← ALL TOOLS
// NETWORK & UTILITY · BROWSER

Regex Tester

Test a JavaScript regular expression against text and see every match and capture group highlighted.

NETWORK · IN YOUR BROWSER

Runs in your browser; nothing you type leaves this page. Too long to share as a link.

HISTORY

Your last 5 runs appear here for 7 days, on this device only.

RESULT

Fill in the form and run the tool; the result appears here.

Regex Tester runs a regular expression against sample text you provide, highlighting every match and listing its capture groups, entirely in your browser with its JavaScript regex engine.

How to read the result

Matches are highlighted directly in the sample text. A list under it gives the match count and, for the first 30 matches, each match's position and numbered capture groups, so you can confirm a pattern extracts exactly the parts you intend, not just that it matches somewhere. The flags default to g and m; m makes ^ and $ match at every line.

Defender tips

  • Check any input-validation pattern for catastrophic backtracking (ReDoS) before shipping it; a pattern with nested quantifiers over similar characters can take exponentially longer on certain crafted inputs, turning validation into a denial-of-service vector.
  • Anchor patterns with ^ and $ (or \A and \z in engines such as PCRE and Ruby) when you mean to validate an entire string, and test them without the m flag; an unanchored pattern that merely finds a match somewhere inside the string is a common source of validation bypasses.
  • Prefer well-reviewed, widely used patterns for things like email addresses and URLs over a hand-rolled one; these look simple but have surprisingly many edge cases that matter for correctness and security alike.

FAQ

Which regex flavour does this use?

Your browser's built-in JavaScript engine, so syntax and supported features (lookbehind, named groups, the d, s, u, v and y flags) match what a JavaScript regex accepts. Patterns for Python, PCRE or .NET can behave differently.

Does it check for ReDoS automatically?

No. The pattern runs directly in your tab, so a catastrophic one can make the page stop responding for a while. Treat any pattern with nested repetition over overlapping character classes as worth reviewing by hand or with a dedicated ReDoS checker before it validates untrusted input.

Why is lookbehind unsupported in some environments?

Older JavaScript engines did not implement lookbehind assertions; modern browsers and Node.js versions do, so this depends on where the pattern will actually run, not on this tool.