提问人:johnjon432183556 提问时间:9/4/2022 最后编辑:RavinderSingh13johnjon432183556 更新时间:9/4/2022 访问量:164
如果 (.*) 包含字符串,则正则表达式不匹配
Regex do not match if (.*) contains a string
问:
我正在尝试匹配 URL 中的字符串及其后面的所有字符串,除非它后面的内容包含某个字符串。
我试过了:
(?:/path/)(.*)
示例字符串:
//https://example.com/path/css/style (match)
//https://example.com/path/css/style2 (match)
//https://example.com/path/css/notstyle (match)(but I'm looking for it to not)
答:
上一个:如何避免匹配枚举时出现语法重复?
下一个:如何在Excel中选择匹配的模板
评论