案例
Normalize repeated spaces in a copied HTTP request
输入
GET /health HTTP/1.1
Host: example.orgExpected answer
GET /health HTTP/1.1
Host: example.org- 查找
{"option":"Regex","string":"[ \\t]+"}- 替换为
- 全局匹配
On- 不区分大小写
Off- 多行匹配
On- 点号匹配所有字符
Off
Redact a demo bearer token while retaining the header name
输入
Authorization: Bearer DEMO_TOKEN_NOT_VALID
Accept: application/jsonExpected answer
Authorization: Bearer [REDACTED]
Accept: application/json- 查找
{"option":"Regex","string":"(Authorization: Bearer )\\S+"}- 替换为
$1[REDACTED]- 全局匹配
On- 不区分大小写
Off- 多行匹配
On- 点号匹配所有字符
Off
Move endpoint URLs to a new hostname literally
Simple string treats the dots as dots, rather than regular-expression wildcards.
输入
https://old.example.org/v1/status
https://old.example.org/v1/jobsExpected answer
https://api.example.org/v1/status
https://api.example.org/v1/jobs- 查找
{"option":"Simple string","string":"old.example.org"}- 替换为
api.example.org- 全局匹配
On- 不区分大小写
Off- 多行匹配
On- 点号匹配所有字符
Off
Complete only the first item in a task list
输入
TODO: write test
TODO: deployExpected answer
DONE: write test
TODO: deploy- 查找
{"option":"Simple string","string":"TODO"}- 替换为
DONE- 全局匹配
Off- 不区分大小写
Off- 多行匹配
On- 点号匹配所有字符
Off
Disable debug flags with case-insensitive line matching
输入
DEBUG=true
port=8080
debug=trueExpected answer
debug=false
port=8080
debug=false- 查找
{"option":"Regex","string":"^debug=(?:true|false)$"}- 替换为
debug=false- 全局匹配
On- 不区分大小写
On- 多行匹配
On- 点号匹配所有字符
Off
参数
| 参数 | 默认值 | 输入与选项 |
|---|---|---|
| 查找 | {"option":"Regex","string":""} | 密钥或文本编码: 正则表达式, Extended (\n, \t, \x...), Simple 字符串 |
| 替换为 | "" | 支持 \n、\r 和 \t 等转义序列 |
| 全局匹配 | true | 开启或关闭 |
| 不区分大小写 | false | 开启或关闭 |
| 多行匹配 | true | 开启或关闭 |
| 点号匹配所有字符 | false | 开启或关闭 |