iToolsPro

文本查找替换

按普通文本或正则模式查找并批量替换,支持忽略大小写、全词匹配与反向引用

查找替换设置
提示:处理在本地完成,数据不会上传。正则模式可用 () 分组与 $1、$2 反向引用。
输入 / 结果
Find · Replace · Regex

查找替换,正则批量一次搞定

普通文本或正则模式查找,支持忽略大小写、全词匹配与反向引用,整段文本一键批量替换,本地处理零上传。

100% 本地处理 · 数据不上传

核心特性

正则模式
用正则表达式匹配复杂模式,配合 () 分组与 $1、$2 反向引用重组结果。
灵活选项
忽略大小写、全词匹配按需开关,普通文本自动转义,避免误匹配。
批量替换
整段粘贴多行文本,一次替换所有匹配,统计替换次数,即点即复制。

适用场景

💻 代码重构 🗄 数据清洗 📝 文档统一 📜 日志规整

文本查找替换指南Find & Replace Guide

了解普通/正则模式、反向引用与常见问题。Literal vs regex mode, backreferences, and answers to common questions.

功能说明What It Does

文本查找替换工具按查找内容(普通文本或正则表达式)匹配并批量替换整段文本。支持忽略大小写、全词匹配,正则模式可配合 () 分组与 $1、$2 等反向引用。

This tool matches text by a find pattern (literal or regex) and bulk-replaces across the whole input. Case-insensitivity and whole-word matching are supported; regex mode allows () groups and $1, $2 backreferences.

全部在浏览器本地完成,数据不会上传。

Everything runs locally in your browser - nothing is uploaded.

正则与反向引用Regex & backreferences

勾选「正则」后,查找内容按正则解析。例如 (\d{4})-(\d{2})-(\d{2}) 可匹配 2026-08-01,替换为 $1/$2/$3 得 2026/08/01。普通文本模式会自动转义特殊字符,避免误匹配。

With "regex" enabled, the find field is parsed as a regular expression. E.g. (\d{4})-(\d{2})-(\d{2}) matches 2026-08-01 and replacing with $1/$2/$3 gives 2026/08/01. Literal mode auto-escapes special characters to avoid false matches.

使用步骤How to Use

  1. 输入查找内容与替换内容。Enter the find text and replacement.
  2. 按需开启正则、忽略大小写或全词匹配。Enable regex, ignore-case or whole-word as needed.
  3. 粘贴文本,点击「替换全部」并复制结果。Paste text, click "Replace all" and copy the result.

常见问题FAQ

Q1. 普通文本里的 . * 会被当正则吗?Q1. Are . * treated as regex in literal mode?

不会,普通模式会自动转义特殊字符;需要正则能力时勾选「正则」。No - literal mode auto-escapes special characters; enable "regex" for regex power.

Q2. 反向引用怎么写?Q2. How do backreferences work?

在正则里用 () 分组,替换为输入 $1、$2 引用对应分组内容,$& 表示整个匹配。Use () groups in the regex and reference them as $1, $2 in the replacement; $& refers to the whole match.

Q3. 替换会破坏原文本吗?Q3. Does replacing alter my source?

原输入保持不变,结果单独显示在右侧,确认无误后手动复制即可。Your source stays untouched; the result appears separately on the right for review before you copy it.