Skip to content
MixTool

Regex tester

Build and debug regular expressions with live highlighting, capture groups, find-and-replace and ready-made patterns.

  • Runs entirely in your browser
  • Free · no sign-up
  • Works on phone and desktop
Loading tool…

See exactly what your pattern matches

Type a regular expression and some test text, and every match is highlighted as you type. The results table lists each match with its position and all capture groups, including named groups like (?<year>\d{4}). Toggle flags — global, ignore case, multiline, dot-all, unicode and sticky — with one click.

Switch to Replace mode to preview substitutions using $1, $<name> and $&. Patterns run in a background thread with a time limit, so a runaway pattern (catastrophic backtracking) is stopped instead of freezing your browser. Common patterns for emails, URLs, US phone numbers, ZIP codes, dates and IP addresses are one click away.

How to test a regular expression

  1. 1

    Enter the pattern

    Or pick a common pattern; /pattern/flags literals are accepted too.

  2. 2

    Choose flags

    g, i, m, s, u or y.

  3. 3

    Add test text

    Matches highlight instantly.

  4. 4

    Try a replacement

    Preview the result with group references.

Key features

  • Live highlighting

    Alternating colors make adjacent matches easy to tell apart.

  • Groups table

    Numbered and named capture groups for every match.

  • Replace preview

    Supports $1, $<name> and $&.

  • Freeze-proof

    Slow patterns are stopped after 1.5 seconds.

Common uses

  • Form validation: Check patterns for emails, phone numbers and ZIP codes.
  • Log parsing: Extract IDs, timestamps and error codes.
  • Bulk edits: Test a find-and-replace before running it on a codebase.

Tips and good to know

  • Nested quantifiers like (a+)+ can take exponentially long on non-matching text. Keep patterns specific.
  • The engine is JavaScript's, so results match Node.js and browsers. Other languages differ slightly, for example in lookbehind support.
  • Need to see a URL's parts instead of regex-matching them? Try the URL Parser.

Frequently asked questions

Which regex flavor does this use?

JavaScript (ECMAScript), the same engine used by Chrome, Node.js and Deno. It supports lookbehind, named groups and Unicode property escapes.

Why does my pattern only match once?

Without the g (global) flag, only the first match is found. Turn on g to find all of them.

How do I match a literal dot or bracket?

Escape it with a backslash: \. matches a dot and \[ matches an opening bracket.

What is catastrophic backtracking?

Some patterns try an exponential number of combinations on text that almost matches. The tester stops them after 1.5 seconds and tells you why.