Regex Tester Online – Real-time Match, Capture Groups, Replace Tool

Templates:
Flags:
Test Text
Matches: 0

Match Result

Preview...
  1. Enter a regex pattern or select a common template
  2. Toggle flags to adjust matching mode
  3. Enter test text in the input area
  4. View match results and capture group details
  5. Optional: Use replace function for text substitution

Help

FAQ

What do regex flags do?Show
g=global (find all matches), i=case-insensitive, m=multiline, s=dotAll (. matches newline), u=Unicode mode, y=sticky match
How to view capture groups?Show
Wrap regex parts with parentheses (). The results panel shows each capture group's content and index.
How does regex replace work?Show
Expand "Replace Function", enter replacement text (supports $1, $2 etc. for group references), click replace to see results.
What common templates are available?Show
Email, phone number, URL, IP address, date, number, Chinese characters, HTML tags and more.
Is my data uploaded?Show
No. All testing happens locally in your browser. Nothing is uploaded to any server.

Quick Start

  1. Enter a regex pattern or select a common template
  2. Toggle flags to adjust matching mode
  3. Enter test text in the input area
  4. View match results and capture group details
  5. Optional: Use replace function for text substitution

Privacy Notice

Full guide

Regex Tester Online

Features

  • Real-time Match Preview - Match as you type, highlighted results
  • Capture Group Display - Clearly shows each group's content
  • Regex Replace - Supports capture group references
  • Common Templates - One-click load for email, phone, URL, etc.
  • Flags Toggle - Intuitive matching mode switches
  • Local Storage - Save your frequently used patterns

Regex Basics

Regular Expressions are powerful pattern matching tools used for:

  • Form Validation - Email, phone, ID card format checking
  • Text Processing - Search, replace, extract specific content
  • Data Cleaning - Log analysis, format conversion
  • Web Scraping - Extract specific information from pages

Common Regex Patterns

PurposePattern
Email[\w.-]+@[\w.-]+\.\w+
Phone (US)\d{3}[-.]?\d{3}[-.]?\d{4}
URLhttps?://[\w./-]+
IP Address\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}
Date\d{4}-\d{2}-\d{2}
Number-?\d+\.?\d*
HTML Tag<[^>]+>

Related Tools