Skip to content
Shrake DevTools
  • JSON FormatterData & Format
  • JSON ValidatorData & Format
  • JSON MinifierData & Format
  • JSON ↔ YAML ConverterData & Format
  • XML FormatterData & Format
  • Base64 Encoder / DecoderData & Format
  • URL Encoder / DecoderData & Format
  • JWT InspectorData & Format
↑ ↓ to navigate↵ to openEsc to close

Regex Tester

Test regular expressions with live match highlighting, capture groups, flags and explanations.

Runs locally in your browser. Your input is not uploaded.Free, no sign-up

Test string

Enter a pattern and some text to see matches.

How to use the Regex Tester

  1. Type a regular expression, or pick one from Examples.
  2. Toggle flags such as global, ignore case and multiline.
  3. Paste a test string. Matches are highlighted as you type, with their capture groups listed alongside.
  4. Tick Replace matches to preview a replacement using $1, $<name> or $&.
  5. Read the explanation to see what each part of the pattern does.

Protected against catastrophic backtracking

Some patterns, especially nested quantifiers like (a+)+ or (\w+\s?)*, can take exponential time on certain inputs and freeze a browser tab, or a server (a "ReDoS" vulnerability). Here, matching runs in a background worker and is stopped after 1.5 seconds, and the explanation warns about risky nested quantifiers before you ship them.

Which regex flavor is this?

JavaScript (ECMAScript) regular expressions, as used by browsers, Node.js and TypeScript. Most syntax is shared with Java, Python and PCRE, including lookbehind and named groups. A few features differ, such as possessive quantifiers and inline flags like (?i), which JavaScript doesn't support.

Frequently asked questions

Is my text uploaded?

No. Everything runs in your browser. Log files and data you test against never leave your machine.

Why does my pattern match an empty string?

Patterns that can match nothing, like a*, match an empty string at positions where the text doesn't match. Use + instead of * if you need at least one character.

Why do I need the g flag?

Without global, only the first match is found and only the first occurrence is replaced.