Regex Tester

Test regular expressions against sample text. Match finds patterns with positions, Replace substitutes matches (use $1, $2 for capture groups), and Extract lists all matches. Complex patterns on very long input may still be slow.

  • Runs entirely in your browser
  • No data stored or sent to a server
  • Free forever — no signup
  • Instant conversion

Input and Output

Use the interactive encoder and decoder on this page to process your text.

Learn more about regular expressions

How to Test Regular Expressions

Regex Testing

Regex Modes

  • Match — test whether the pattern matches and show all matches with positions and context
  • Replace — substitute matches with a replacement string (supports $1, $2 groups)
  • Extract — list every match value from the input

Common Flags

  • g — find all matches, not just the first
  • i — case-insensitive matching
  • m — ^ and $ match line boundaries
  • s — dot matches newlines

JavaScript Regex Syntax

This tool uses JavaScript regular expressions (ECMAScript). Lookahead, capture groups, and backreferences follow JS semantics — which may differ from PCRE or Python regex. Some risky patterns are blocked; very long input may still be slow.

Frequently asked questions

Why does my regex work in Python but not here?

Different languages have different regex engines. JavaScript lacks some PCRE features (e.g. recursive patterns) and has different escaping rules.

How do capture groups work?

Parentheses create capture groups. In Replace mode, use $1, $2, etc. to reference captured text. Match mode shows group values for each match.