Skip to main content
C
CodeUtil

Regex Tester

Test and debug regular expressions with live highlighting and match results.

Loading...

How to Use the Regex Tester

This online regex tester allows you to test and debug regular expressions in real-time. Enter your regex pattern in the pattern field, then type or paste your test string. Matches will be highlighted instantly as you type.

Features

  • Live Highlighting - See matches highlighted in real-time as you type
  • Flag Support - Toggle global (g), case-insensitive (i), multiline (m), dotall (s), and unicode (u) flags
  • Match Details - View match text, position, and capture groups
  • Replace Mode - Test find-and-replace with capture group references ($1, $2, etc.)
  • Common Patterns - Quick access to frequently used patterns like email, URL, and phone
  • Cheat Sheet - Built-in reference for regex syntax

Useful with the JSON Formatter for log parsing and the URL Encoder when testing patterns against query strings.

Regex Flags Explained

  • g (Global) - Find all matches, not just the first one
  • i (Case Insensitive) - Match regardless of letter case
  • m (Multiline) - ^ and $ match start/end of each line
  • s (Dotall) - Dot (.) matches newline characters
  • u (Unicode) - Enable full Unicode support

Frequently Asked Questions

Is my data secure?

Yes! All regex processing happens entirely in your browser. Your patterns and test strings are never sent to any server.

What regex flavor is supported?

This tester uses JavaScript's native RegExp engine, which supports ECMAScript regex syntax. This is compatible with most modern programming languages and tools.

How do I use capture groups in replacement?

Use $1, $2, $3, etc. to reference captured groups in your replacement string. For example, with pattern (\w+)@(\w+) and replacement $2:$1, the text "user@domain" becomes "domain:user".