Skip to content

Commit

Permalink
docs: 补充 @js: 规则例子
Browse files Browse the repository at this point in the history
  • Loading branch information
aooiuu committed Sep 16, 2024
1 parent ea6c031 commit bb712b8
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions docs/rule/expression.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
| `@css` | 使用 css 选择器查找内容 [规则测试][@css] | `@css:.box1 .box2@text` |
| `@json` | 使用 jsonpath 查找内容 [规则测试][@json] | `@json:$.list[:1].title` |
| `@xpath` | 使用 xpath 查找内容 [规则测试][@xpath] | `@xpath://*[@class="box3"]/text()` |
| `@js` | 使用 js 脚本 | `@js:1+1` |
| `@js` | 使用 js 脚本 [规则测试][@js] | `@js:1+1` |
| `@filter` | 模拟浏览器加载地址后匹配指定链接 | `@filter:(?:m3u8\|mp4)` |
| `@replace` | 替换匹配到的内容为空 [规则测试][@replace] | `@replace:\d` |
| `##` | 正则替换 [规则测试][##] | `$.a##2##替换文本` |
Expand All @@ -14,10 +14,11 @@

规则可以省略开头的,**@css****@xpath****@json**, 因为解析器会尝试自动识别。

[@css]: /play/?_t=1#eyJpbnB1dFRleHQiOiI8ZGl2IGNsYXNzPVwiYm94MVwiPjxkaXYgY2xhc3M9XCJib3gyXCI+Y29udGVudDwvZGl2PjwvZGl2PiIsInJ1bGUiOiIuYm94MSAuYm94MkB0ZXh0IiwiaXNMaXN0IjpmYWxzZX0=
[@json]: /play/?_t=2#eyJpbnB1dFRleHQiOiJ7XCJhXCI6IDF9IiwicnVsZSI6IiQuYSIsImlzTGlzdCI6ZmFsc2V9
[@xpath]: /play/?_t=3#eyJpbnB1dFRleHQiOiI8ZGl2IGNsYXNzPVwiYm94MVwiPjxkaXYgY2xhc3M9XCJib3gyXCI+Y29udGVudDI8L2Rpdj48ZGl2IGNsYXNzPVwiYm94M1wiPmNvbnRlbnQzPC9kaXY+PC9kaXY+IiwicnVsZSI6Ii8vKltAY2xhc3M9XCJib3gzXCJdL3Rle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Bjc3M6dGFibGUgdGhAaHRtbCIsImlzTGlzdCI6ZmFsc2V9
[@replace]: /play/#eyJpbnB1dFRleHQiOiJhMTJiM2MiLCJydWxlIjoiQHJlcGxhY2U6XFxkIiwiaXNMaXN0IjpmYWxzZX0=
[##]: /play/#eyJpbnB1dFRleHQiOiJ7XCJhXCI6IFwiMTIzXCJ9IiwicnVsZSI6IiQuYSMjMiMj5pu/5o2i5paH5pysIiwiaXNMaXN0IjpmYWxzZX0=
[​拼接]: /play/#eyJpbnB1dFRleHQiOiJ7XCJhXCI6IDF9IiwicnVsZSI6InF7eyQueHx8JC5hfX13IiwiaXNMaXN0IjpmYWxzZX0=
[]: /play/#eyJpbnB1dFRleHQiOiJ7XCJhXCI6IFwiMVwifSIsInJ1bGUiOiIkLmJ8fCQuYSIsImlzTGlzdCI6ZmFsc2V9

0 comments on commit bb712b8

Please sign in to comment.