Text replace
Bulk-replace text with plain or regular-expression rules (including $1 back-references), replace all or one at a time, toggle case sensitivity, chain multiple rules and inspect counts plus a word-level diff.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
In plain mode \n \t \r \0 \\ become real characters; in regex mode only the replacement is unescaped this way.
Result
Enter text and at least one rule to see the result
Diff
unchanged
What this tool does
- Apply the same edit to a whole document at once — rename a function, standardise terminology, swap English placeholders for real copy — without clicking replace over and over.
- Clean data in batches: one "find => replace" rule per line, blank lines and # comments ignored, with a per-rule match count so you can see exactly what changed.
- Do structured rewrites with regular expressions, for example turning #1234 into [1234] using $1, $2 and $& back-references.
- Check the word-level diff and the replacement counts before you copy the result, so nothing gets clobbered by accident.
Example
Input
hello world hello unikit
Output
你好 世界 你好 unikit
Two rules are used: hello => 你好 and world => 世界. Rules run top to bottom, so each one works on the previous rule's output.
Frequently asked questions
What is the difference between plain text and regex mode?
Plain mode treats the search text literally, so . * ( ) have no special meaning and $1 in the replacement is not expanded. Regex mode treats the search text as a pattern and lets the replacement use $1, $2, $& and $<name>; write $$ for a literal dollar sign.
Why did the \n in my replacement turn into a real line break?
"Interpret escape sequences" is on by default: in plain mode \n \t \r \0 and \\ become real characters, which is handy for turning commas into newlines. Turn it off to keep a literal backslash; in regex mode only these escapes in the replacement are interpreted.
In what order do multiple rules run?
In the order you wrote them — each rule receives the output of the one above. Deleting spaces before replacing words is not the same as the other way round, so the order matters.
The count says 0 replaced. Why?
That rule matched nothing. The usual causes are a case mismatch (matching is case sensitive by default), stray spaces in the search text, a missing escape in a regex, or an earlier rule having already rewritten the text.
Is my text uploaded?
No. Matching and replacing run entirely in your browser with JavaScript; the page makes no network requests and your text is never logged.
Keywords:replace替换批量替换正则替换regEx replace文本处理diff查找替换$1