博文

目前显示的是标签为“RegExp”的博文

sed -e 和 sed -E 的区别 如果讨厌在(前面加\,那么就使用 -E参数吧

图片
官方说明:   -E, -r, --regexp-extended                  use extended regular expressions in the script                  (for portability use POSIX -E). 详细解释 5.2 Basic (BRE) and extended (ERE) regular expression Basic and extended regular expressions are two variations on the syntax of the specified pattern. Basic Regular Expression (BRE) syntax is the default in  sed  (and similarly in  grep ). Use the POSIX-specified  -E  option ( -r ,  --regexp-extended ) to enable Extended Regular Expression (ERE) syntax. In GNU  sed , the only difference between basic and extended regular expressions is in the behavior of a few special characters: ‘ ? ’, ‘ + ’, parentheses, braces (‘ {} ’), and ‘ | ’. With basic (BRE) syntax, these characters do not have special meaning unless prefixed with a backslash (‘ \ ’); While with extended (ERE) syntax it is reversed: these characters are special unless they are prefixed with backslash (‘ \ ’). source:  https://www.gnu.org/software/sed/manual/sed.html#BRE-vs-ERE

正则表达式实现 非pattern ^((?!pattern).)+$

图片
需求: 我希望他遇到v2ray.com本身和google.com及其子域名時不匹配 其他域名都匹配 答案: ^((?!(^v2ray.com$|^google\.com$|^.*\.google\.com$)).)+$

The Hot3 in Last 30 Days

无服务器 自建短链服务 Url-Shorten-Worker 完整的部署教程

ClouDNS .asia免费域名 托管到CloudFlare开CDN白嫖Websocket WS通道翻墙 / desec.io