Regex Live Replace

Type a regex pattern and replacement string to see live substitution results with full backreference support.

/ /
Flags:

Input Text

Result

Quick Reference

$1, $2 …
Numbered capture group in replacement
$<name>
Named capture group: (?<name>...)
$$
Literal dollar sign in replacement
$` / $'
Text before / after the match
Copied!

Summary

Type a regex pattern and replacement string to see live substitution results with full backreference support.

How it works

  1. Paste or type your input text in the left panel.
  2. Enter a regular expression pattern in the Pattern field.
  3. Enter a replacement string — use $1, $2 (or \1, \2) for captured groups.
  4. Toggle flags: g (global), i (case-insensitive), m (multiline).
  5. The right panel updates instantly showing the replaced output.
  6. Click "Copy Result" to copy the transformed text to your clipboard.

Use cases

  • Rename variables across a code snippet using capture groups.
  • Strip or reformat dates, phone numbers, or structured text.
  • Test and iterate on regex substitutions before using them in code.
  • Convert camelCase identifiers to snake_case with a single pattern.
  • Remove HTML tags or unwanted whitespace from copied content.
  • Reorder CSV columns by capturing fields and reordering backreferences.
  • Batch-rename file name patterns in a manifest or list.
  • Preview regex behavior across multiline input before running in production.

Frequently Asked Questions

Last updated: 2026-06-09 · Reviewed by Nham Vu