Regex Tester

Test regex with live highlighting & groups

Test and debug regular expressions with real-time match highlighting, group extraction, substitution, and a visual explanation of your pattern.

How to Use Regex Tester

  1. 1Type or paste a regular expression in the "Pattern" field (without delimiters)
  2. 2Select the flags (g, i, m, s, u) for global, case-insensitive, multiline, dotall, or unicode
  3. 3Enter test text - all matches highlight instantly in the text
  4. 4Switch to "Replace" mode to test search-and-replace with a replacement string
  5. 5View the visual explanation panel to understand what each part of your regex does

Features

  • Real-time match highlighting as you type - instant visual feedback
  • Match details panel showing each match, its position, and captured groups
  • Replace mode with live preview of search-and-replace results
  • Visual regex explanation - breaks down your pattern into readable components
  • Common pattern presets: email, URL, phone, date, IP address, credit card, and more
  • Cheat sheet with quick reference for common regex syntax
  • Flags selector: g, i, m, s, u
  • Match count and details summary
  • Copy regex pattern and copy all matches with one click
  • Runs entirely in your browser - no data sent to any server

Frequently Asked Questions

Do I include the delimiters in the pattern?

No. Type only the pattern itself without delimiters. For example, type "\d+" not "/\d+/". Delimiters are added automatically when copying.

What do the flags mean?

g = global (find all matches, not just the first), i = case-insensitive, m = multiline (^ and $ match line boundaries), s = dotall (. matches newlines), u = unicode (treat pattern as unicode).

What is a capturing group?

A capturing group is a part of the pattern wrapped in parentheses (...). It captures the matched text for that part separately. Named groups use (?<name>...) syntax.

Can I test regex replacement?

Yes. Toggle to "Replace" mode, enter a replacement string using $1, $2 etc. for captured groups, and see the result instantly.

Are my patterns saved or sent anywhere?

No. Everything runs locally in your browser using JavaScript's RegExp engine. Your patterns and test data never leave your device.

What regex syntax is supported?

The tool uses JavaScript's built-in RegExp engine, which supports most common regex features including lookaheads, lookbehinds, named groups, and Unicode property escapes.