跳到主要内容

批量查找替换

UpBox优盒工具箱,免费在线批量查找替换工具,支持正则表达式、捕获组、忽略大小写、全词匹配与多行模式,替换结果可复制或下载。

无需注册 · 数据不上传No sign-up · nothing uploaded

原始文本Source text

正则模式下可用 $1、$2 引用捕获组;全词匹配对中文不生效

替换结果Result

匹配次数0
字符变化0
结果字符0
填写查找内容后自动替换
本工具所有运算在本地浏览器完成,你的文件、文本不会上传到服务器

工具介绍

粘贴一段文字,填上查找内容和替换内容,右侧立刻给出结果与匹配次数。普通模式按字面匹配,替换内容里的 $ 不会被当成特殊符号。 Paste some text, fill in find and replace, and the result plus match count appears on the right. Plain mode matches literally, so $ stays literal.

打开正则模式后可以用 ( ) 分组、用 $1 引用捕获内容,配合忽略大小写与多行模式处理日志、文案和代码片段。 Switch on regex mode to group with ( ) and reference captures as $1, together with case-insensitive and multiline handling for logs, copy and code.

  • 正则替换Regex replace
  • 捕获组 $1Capture groups
  • 忽略大小写Ignore case
  • 全词匹配Whole word
  • 复制与下载Copy & download

使用说明

  1. 粘贴原始文本。Paste the source text.
  2. 填写查找内容与替换内容。Fill in find and replace.
  3. 按需打开正则、忽略大小写等选项。Enable regex or case options as needed.
  4. 核对匹配次数后复制或下载。Check the match count, then copy or download.

常见问题

替换内容里的 $ 会被解析吗?Is $ interpreted in the replacement?
普通模式不会,按字面写入;正则模式下 $1 表示第一个捕获组。Not in plain mode — it is literal. In regex mode $1 means the first capture group.
全词匹配对中文有效吗?Does whole word work for Chinese?
无效,\b 依赖拉丁字母的单词边界;中文请用正则自行限定上下文。No, \b relies on Latin word boundaries; use a regex context for Chinese.
能替换多行内容吗?Can it replace across lines?
勾选多行模式后 ^ 和 $ 可匹配每一行的开头结尾;跨行匹配请用 \n 或 [\s\S]。Enable multiline so ^ and $ match each line; use \n or [\s\S] to span lines.
文本会上传吗?Is the text uploaded?
不会,替换完全在浏览器本地完成。No, it all runs locally in the browser.
广告位

此处为广告位,可放置你的推广素材

支持图片、文字或 HTML 代码,替换本区块内容即可投放

浏览其他分类