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
- Paste or type your input text in the left panel.
- Enter a regular expression pattern in the Pattern field.
- Enter a replacement string — use $1, $2 (or \1, \2) for captured groups.
- Toggle flags: g (global), i (case-insensitive), m (multiline).
- The right panel updates instantly showing the replaced output.
- 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