Text Replacer
Batch find & replace with regex support.
Run multiple rules at once with diff view.
🔒Text is never sent to any server.
About
A batch text replacement tool that runs in your browser. Supports regex and multiple simultaneous rules. Unlike the existing regex-checker (focused on match testing), this tool is focused on executing replacements and outputting results.
How to Use
Set Replacement Rules
Enter search and replace pairs. Toggle regex, case sensitivity, and replace-all options.
Paste Input Text
Paste the target text into the left area.
Execute & Copy
Click Execute, review the result on the right, then copy or save.
Glossary
- Regular Expression (Regex)
- A language to describe text patterns. Special symbols like \d (digit), \s (whitespace), [a-z] (lowercase) enable flexible matching.
- Global Match (Replace All)
- The g flag in regex. Replaces all occurrences in the text. Off = replace only the first match.
- Back-reference ($1, $2…)
- Insert captured regex group content into the replacement string. E.g., /(\w+)/ → $1_new
- Escape
- Prefix a special regex character with \ to treat it as a literal. E.g., \. matches a literal period.
- Diff View
- Visually displays changes between original and result with red (deleted) and green (added) highlighting.
- Capture Group
- Parentheses () in a regex. The matched content can be referenced as $1, $2, etc. in the replacement.
FAQ
- Q.Is my text sent to a server?
- No. All processing happens locally in your browser. Safe to use with confidential text.
- Q.Are back-references ($1) supported?
- Yes. JavaScript's native regex.replace supports $1, $2, etc. back-references in the replacement string.
- Q.How many rules can I add?
- No hard limit, but large numbers of rules may slow processing on large texts.
- Q.Does it work with TSV/CSV?
- Yes. Paste the content as text and use \t (tab) or comma in regex to target delimiters.
- Q.What happens with an invalid regex?
- An error message is shown for that rule and it is skipped. Other valid rules continue to run.
Use Cases
CSV Data Cleansing
Remove extra spaces, convert delimiters, standardize date formats.
Bulk Variable Renaming
Rename oldVariableName to newVariableName across a code snippet using word boundary regex.
Document Style Standardization
Unify inconsistent terminology or writing style variations in a document.
Personal Data Masking
Mask phone numbers with regex: \d{3}-\d{4}-\d{4} → ***-****-****.