Skip to main content
Back to Tools
Web Tools

Regex Tester

Test regular expressions with live match highlighting, capture group display, and flag toggles. All processing happens in your browser — your data stays private.

regex regexp tester pattern-matching developer-tools

Published March 21, 2026

All interactive tools run entirely in your browser. Your data never leaves your device.

How It Works

Enter a regex pattern and test string — matches are highlighted in real-time as you type. Toggle flags to control matching behavior and view capture groups for each match.

Features

  • Live Highlighting: Matches highlighted instantly as you type the pattern or test string
  • Flag Toggles: Global (g), case insensitive (i), multiline (m), and dotall (s)
  • Capture Groups: Named and numbered groups displayed for each match
  • Match Count: Total matches shown with individual match details
  • Error Feedback: Invalid patterns show the browser’s native error message

Common Patterns

Here are some useful regex patterns to get started:

  • Email: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
  • URL: https?://[^\s/$.?#].[^\s]*
  • Phone (US): \(?[0-9]{3}\)?[-.\s]?[0-9]{3}[-.\s]?[0-9]{4}
  • Date (YYYY-MM-DD): \d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])
  • IPv4 Address: \b(?:\d{1,3}\.){3}\d{1,3}\b
  • Hex Color: #(?:[0-9a-fA-F]{3}){1,2}\b

Regex Quick Reference

PatternMatches
.Any character (except newline without s flag)
\dDigit (0-9)
\wWord character (letter, digit, underscore)
\sWhitespace
^ / $Start / end of string (or line with m flag)
* / + / ?0+, 1+, 0 or 1
{n,m}Between n and m occurrences
(...)Capture group
(?:...)Non-capturing group
(?=...)Positive lookahead
[abc]Character class