文字与文档工具

文本替换

在浏览器中按首个或全部匹配替换字面量或JavaScript正则;字面量支持区分/忽略大小写和Unicode完整词项,正则支持i/m/s/u标志与原生替换引用。报告匹配数并支持复制与TXT下载;正则在独立Worker中执行并于1秒终止,最多50,000个匹配、500,000个输出字符。

优先本地处理无需注册隐私说明 ↗

Maximum 100,000 UTF-16 characters. Processing stays in this browser.

One to 10,000 literal characters. Special characters never become regular-expression syntax.

Applies a boundary only at word-like edges of the search text.

Inserted literally; an empty value deletes each match.

使用步骤

如何使用

  1. Enter up to 100,000 characters and choose literal text or regular expression.
  2. Set first or all matches plus the mode-specific case, whole-term, and regular-expression flags.
  3. Replace locally, review the match count and result, then copy it or download a text file.

Literal mode with Unicode term boundaries

Literal mode treats dots, brackets, dollar signs, backslashes, and every other search character as ordinary text. Matching can respect or ignore case, work anywhere, or require Unicode letter, number, combining-mark, and underscore boundaries at the search text’s word-like edges. Replacement text stays literal, including dollar signs. Choose the first match or every non-overlapping match.

Isolated regular expressions with native replacement syntax

Regular-expression mode accepts a raw JavaScript pattern without surrounding slashes. Choose ignore-case, multiline, dot-all, and Unicode flags; first/all controls the global flag. JavaScript replacement references such as $$, $&, $1, and $<name> use their native meaning. The expression runs in a temporary Web Worker that is terminated after one second. Input is limited to 100,000 characters, pattern to 1,000, matches to 50,000, and output to 500,000 characters.

常见问题

你可能还想知道

Are dollar signs special in replacement text?

They remain literal in literal mode. In regular-expression mode, JavaScript replacement references are enabled, so use $$ when you need one literal dollar sign.

Can a regular expression freeze the page?

The expression runs outside the page in a temporary Worker and is stopped after one second. Shorten the input or simplify the pattern if it reaches that limit.

Does whole-term mode use English-only word boundaries?

No. It treats Unicode letters, numbers, combining marks, and underscores as word characters at the search text’s applicable edges.