Skip to content
StackDecode

Regex Tester

Test JavaScript regular expressions live, with match highlighting, capture groups and a plain-English breakdown.

NewmediumRuns in your browser

How it works

A regular expression is a compact pattern for matching text. This tester uses your browser’s own JavaScript RegExp engine, so results match what you would get in JS and TypeScript. Other languages (Python, Java, PCRE) differ in some details such as lookbehind and named-group syntax.

  • Flags change behaviour: g finds every match, i ignores case, m makes ^ and $ line-aware, s lets . match newlines.
  • Groups ( ) capture text; (?<name>…) gives the capture a name; (?:…) groups without capturing.
  • Quantifiers are greedy by default (take as much as possible). Add ? to make them lazy.
  • Lookarounds check what is before or after without consuming it.
  • Matching runs in a background worker with a 1.5-second limit. Patterns with nested quantifiers such as (a+)+$ can take exponential time on some inputs (ReDoS); the tester stops them instead of freezing the page.