範例
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 | 開啟或关閉 |