正则表达式匹配:curl 或 wget 下载脚本并执行 sh 或 bash/n/n本文将介绍一个正则表达式,用于匹配使用 curl 或 wget 下载脚本并使用 sh 或 bash 执行的命令行语句。/n/n### 正则表达式:/n/nregex/n(|curl.*?http://.*?//i/.sh|wget.*?http://.*?//i/.sh)/s*/|/s*(sh|bash)/n/n/n### 匹配示例:/n/n- curl http://example.com/i.sh | sh/n- wget https://example.com/i.sh | bash/n- curl -L http://example.com/i.sh | bash/n- wget -O- http://example.com/i.sh | sh/n- curl -s http://example.com/i.sh | bash/n/n### 不匹配示例:/n/n- curl http://example.com/i.sh | zsh/n- wget https://example.com/i.sh | fish/n- curl -L http://example.com/i.sh | tcsh/n- wget -O- http://example.com/i.sh | ksh/n- curl -s https://example.com/i.sh | dash/n/n### 正则表达式解析:/n/n- (|curl.*?http://.*?//i/.sh|wget.*?http://.*?//i/.sh): 匹配 curl 或 wget 命令,并包含 http:// 以及 /i.sh 的 URL。/n- /s*/|/s*: 匹配一个或多个空格,以及管道符号 |。/n- (sh|bash): 匹配 sh 或 bash 命令。/n/n### 总结:/n/n该正则表达式能够有效地匹配使用 curl 或 wget 下载脚本并使用 sh 或 bash 执行的命令行语句。

正则表达式匹配:curl 或 wget 下载脚本并执行 sh 或 bash

原文地址: https://www.cveoy.top/t/topic/ouD3 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录