/ /
Enter a pattern to begin
0
Matches
0
Capture Groups
0
Text Length
0%
Match Coverage
—
Time (ms)
📝 Test String & Highlighted Preview 0 characters
Test String (editable)
Highlighted Matches
Matches will highlight here...
🔁 Replace Mode Use $1, $2 for groups — $& for whole match
Replaced text will appear here...
🎯 Matches & Capture Groups 0 matches
No matches yet. Enter a regex pattern above to see results here.
📚 Regex Cheat Sheet ▼

Character Classes

.Any character except newline
\dDigit (0–9)
\DNon-digit
\wWord character (a–z, A–Z, 0–9, _)
\WNon-word character
\sWhitespace
\SNon-whitespace
[abc]Any of a, b, or c
[^abc]Not a, b, or c
[a-z]Character range

Anchors

^Start of string (or line with m)
$End of string (or line with m)
\bWord boundary
\BNon-word boundary

Quantifiers

*0 or more
+1 or more
?0 or 1 (optional)
{n}Exactly n times
{n,}n or more
{n,m}Between n and m
*?Lazy — 0 or more, minimal
+?Lazy — 1 or more, minimal

Groups & Ranges

(...)Capture group
(?:...)Non-capturing group
(?<name>...)Named capture group
|Alternation — a or b
\1, \2Backreference

Lookarounds

(?=...)Lookahead — followed by
(?!...)Negative lookahead — not followed by
(?<=...)Lookbehind — preceded by
(?<!...)Negative lookbehind — not preceded by

Common Examples

\w+@\w+\.\w+Basic email
https?://\S+URL match
\d{4}-\d{2}-\d{2}ISO date
#\w{6}Hex color

What Is a Regex Tester?

A regex tester is a tool for building and debugging regular expressions. You write a pattern, feed it test text, and see immediately which parts of the text match, which capture groups are populated, and where the matches occur. It's essential for anyone who writes regex — developers, data analysts, SEO specialists, system admins, and technical writers.

How to Use This Tool

  • Enter your regex in the input at the top. The pattern goes between the forward slashes.
  • Toggle flags below the pattern — g, i, m, s, u, y.
  • Type or paste test text in the left pane. Matches highlight automatically in the right pane.
  • See details in the Matches panel: position, content, and every capture group.
  • Enable Replace Mode to see what a replacement would produce.

Regex Flags Explained

  • g (global): Find all matches, not just the first one.
  • i (case-insensitive): abc matches ABC, Abc, etc.
  • m (multiline): ^ and $ match the start and end of each line, not just the whole string.
  • s (dotAll): . matches newline characters too. Normally it stops at line breaks.
  • u (unicode): Enables full Unicode support. Required for \p{...} property escapes.
  • y (sticky): Match only at the position of lastIndex. Used for tokenizers.

Example Patterns to Try

Paste this sample text into the test box, then try these patterns:

Contact us at hello@example.com or support@multitoosite.com.
Visit https://multitoosite.com for more tools.
The date is 2025-01-15 and the version is v2.4.1.
Colors: #3b82f6, #10b981, #ef4444.
  • Email: \w+@\w+\.\w+
  • URL: https?://\S+
  • Date (ISO): \d{4}-\d{2}-\d{2}
  • Version: v\d+\.\d+\.\d+
  • Hex color: #\w{6}
  • Named capture: (?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})

Common Use Cases

  • Form validation — check emails, phone numbers, dates, zip codes.
  • Data extraction — pull specific values out of logs or scraped text.
  • Search & replace — bulk edit text with pattern-based substitutions.
  • URL routing — match request paths in web frameworks.
  • Syntax highlighting — build tokenizers for editors.
  • Log parsing — extract structured data from unstructured logs.
  • Text cleanup — normalize whitespace, formatting, and punctuation.

Replacement Syntax

In Replace Mode, the replacement string supports these tokens:

  • $& — the entire match
  • $1, $2, $3 — capture groups by number
  • $<name> — named capture groups
  • $` — text before the match
  • $' — text after the match
  • $$ — a literal dollar sign

Regex Syntax Notes

This tool uses JavaScript (ECMAScript) regex, which is one of the most widely supported engines. Most patterns work identically across JavaScript, Python, PCRE, Go, Java, and .NET — but there are exceptions. Lookbehind, named groups, and Unicode property escapes have slightly different syntax across languages. If you're testing for a specific platform, check that platform's regex documentation for any quirks.

Performance Note

Some patterns can cause "catastrophic backtracking" — where the regex engine tries an exponential number of combinations. If the browser feels frozen, try simplifying your pattern, adding anchors, or using atomic groups (not supported in JavaScript) or possessive quantifiers where available. The timing shown in the stats bar reveals slow patterns.

Related Tools

Privacy Note

Everything runs in your browser. Your patterns and test text are never uploaded to a server, never stored, and never shared.