这个工具做什么?
| 直接答案 | 正则表达式替换将每个匹配项替换为您的替换内容,支持$1, $&, $'引用。 |
| 关键事实 | $& 插入整个匹配项;$1…$9 插入捕获组。 |
| 处理 | 在您的浏览器中本地运行;不会将数据发送到服务器。 |
如何使用
- 输入模式和标志。\n输入替换内容(支持 $1, $&)。\n点击替换匹配项。
示例
输入
Order 42 shipped
输出
Order [42] shipped (模式 \d+, 替换 [$&])
Who is this for?
This tool was built for people who need a fast answer in the browser — no install, no account, no data leaving the device.
Writers cleaning up drafts, developers batch-fixing text, translators, and students. Paste, transform, copy — no signup, no limits.
常见问题
如何使用捕获组?
将部分用( )括起来,并在替换中引用它们为$1, $2。
什么标志可以替换所有匹配项?
g — 如果缺少会自动添加。
我可以使用后瞻断言吗?
是的,在现代浏览器中可以使用;非常旧的Safari可能不支持。