您可以在客户端规则代理规则中输入正则表达式。正则表达式是一个描述字符模式的对象。正则表达式对文本执行模式匹配以及搜索和替换功能。

URL 内容重定向支持以下正则表达式规则。

规则 详细信息
括号 [ ]、[^ ]、( )、(?:)、(?=)
\+元字符或元字符 “\w”、“\W”、“\d”、“\D”、“\b”、“.”
限定符 +、*、?、{x}、{x,y}、{x,}
替换符 |

有关正则表达式的详细信息,请参阅 https://en.wikipedia.org/wiki/Regular_expression

下表包含 URL 内容重定向支持的正则表达式规则示例。

规则条目 匹配的 URL 和 IP 地址示例
.*\.net www.hello.net、www.inter.net、train.word.net、test.train.net 和 train.chromeie.net.com.cn。
.*\.sth\.ctirial example.sth.ctirial、www.google.sth.ctirial 和 www.google.com/test.sth.ctirial/editpage.action。
.*administra www.administra.com、www.askadministra-tor.net 和 google.akmkda.eae/administra.cn。
.*a{4}custom\.com world.banada.cn/aaaacustom.com、www.aaaacustom.com 和 exple.aaaacustom.com.net/nodepad.action。
.*a{2,3}custom\.com world.banada.aacustom.com、www.aaacustom.com 和 exple.aacustom.com.net/nodepad.action。
.*train[abc]\.net hello.traina.net、hello.trainb.net、example.trainc.net. 和 www.testtraina.net.com/edit。
.*train[^abc]\.net hello.traind.net、hello.traine.net、example.train2.net.com 和 www.testtrain3.net.com/edit。
.*a+c*tra\.net www.actra.net.com.aactra.net.cn、atra.net.www.train 和 aaccctra.netword。
.*example(test)?\.cn www.example.cn、www.exampletest.cn、example.cn/editpage 和 exampletest.cn/editpage。
sac(?=sprt) helloworld.sacsprt.net、examplesacsprt.com/text 和 www.sacsprtexam.com。
sac(?!sprt) helloworld.sacspra.net、examplesacbprt.com/text 和 www.sacexam.com。
10\.1\.1\.1[0-5] 10.1.1.10 至 10.1.1.15。
10\.1\.(1|2)\.1[0-5] 10.1.1.10 至 10.1.1.15 以及 10.1.2.10 至 10.1.2.15。
10\.[2-4]\.19\.12 10.2.19.12、10.3.19.12 和 10.4.19.12。
10\.[^2-4]\.19\.12 10.6.19.12、10.1.19.12、10.5.19.12 和 10.7.19.12。
a(\w)cd(\d)345a\.com www.abccd2345a.com.net 和 train.adc2cd1345a.com/edit.action。
abc(\W)cd(\D)345a\.com google.abc+cda345a.com 和 test.train.net/abc&cda345a.com。
((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9]) 所有 IPv4 地址。
.*example(test)?\.cn;10\.1\.1\.1[0-5];a(\w)cd(\d)345a\.com Www.example.cn、example.cn/editpage、10.1.1.10 到 10.1.1.15、www.abccd2345a.com.net 和 train.adc2cd1345a.com/edit.action。