HomeRegular Expression Tester

Regular Expression Tester

Test and debug regular expression patterns with instant match results and replacement functionality

Match Results

No matches found

Match Details

Enter regex pattern and test text to see detailed match information
//

Quick Patterns

Replace Function

Use $1, $2 etc. for capture groups
                  
                
This sed command can be used in Unix/Linux/macOS terminal or Git Bash on Windows


Documentation

About Regex Tester

This tool helps you debug regular expressions online with live matching, highlighted output, capture-group details, replacement preview, and sed command generation.

Key Features

  • Live Matching: Evaluate pattern and input text instantly.
  • Flag Controls: Supports g (global), i (ignore case), and m (multiline).
  • Highlight Preview: Highlights matched segments in source text.
  • Match Details: Shows match items, index positions, and groups.
  • Replace Preview: Test replacement text before using it in code.
  • sed Command Output: Generate shell-friendly replacement commands.
  • Quick Templates: Apply common regex templates with one click.

Flag Reference

Flag Meaning Effect
g global returns all matches; replaces all matches
i ignore case case-insensitive matching
m multiline ^ and $ work per line

Steps

  1. Enter test content in the text area.
  2. Input the regex pattern (without wrapping /).
  3. Enable flags (g, i, m) as needed.
  4. Review match count, highlights, and detail list.
  5. Add replacement text to preview result and copy output or sed command.

Use Cases

  • Form validation rule debugging.
  • Pattern verification before batch extraction/cleanup.
  • Log parsing and text automation script preparation.
  • Terminal replacement command rehearsal.

FAQ

Why are there no matches?

Most cases are caused by incorrect escaping, missing flags, or mismatched anchors.

Why is replacement output unexpected?

Check capture-group references ($1, $2, etc.) and ensure your pattern actually captures those groups.

Is my text uploaded?

No. Processing runs locally in your browser by default.