Other Tools
Regex Replace
Replace text with regular expressions online, with replacement templates, capture group references, named groups, and flag controls.
Flags
Current PatternEnter a pattern to begin replacing.
Replace ModeReplace all matches
Replacement Count0 replacements
Output Length0 characters
Replacement Template Tips
$1References capture group 1, 2, and so on.$&References the full current match.$<name>References a named capture group value.$$Outputs a literal dollar sign.
Replacement Details
Review how each match was transformed by the replacement template.
Replacement details will appear here after the pattern finds matches.
Common Replacement Presets
Load a preset to try typical regex replacement workflows.
Reformat Dates
Turn YYYY-MM-DD into MM/DD/YYYY.
Mask Email Addresses
Keep the first character and domain while hiding the rest of the username.
Collapse Whitespace
Convert repeated spaces, tabs, and line breaks into a single space.
Numbered List to Bullets
Convert ordered steps into Markdown bullet points.
Tool Overview: Regex Replace
Regex Replace lets you transform text in the browser with JavaScript regular expressions. It supports replacement templates such as $1, $2, $&, and $<name>, making it useful for masking, cleanup, and text restructuring tasks.
Supported Features
- Batch text replacement with regex
- Capture group and named group references
g / i / m / s / u / yflag controls- Per-match replacement details
- Copy and download output
How To Use
- Enter a regex pattern and replacement template.
- Toggle the flags you need.
- Paste the source text.
- Review the replaced output and per-match details.
- Copy or download the final result.
Common Use Cases
- Reformat dates
- Mask email addresses, phone numbers, or log fields
- Collapse repeated whitespace
- Convert text structures into Markdown or other formats