开发者

Neither-nor oneline REGEXP

开发者 https://www.devze.com 2023-01-02 16:34 出处:网络
Is it possible to write a regexp rule in \"one line\" that says: neither A nor B. For example: String 开发者_运维知识库must contain NEITHER \"foo\" NOR \"bar\".

Is it possible to write a regexp rule in "one line" that says: neither A nor B.

For example:

String 开发者_运维知识库must contain NEITHER "foo" NOR "bar".

Why one line? Because the filtering tool I am using accepts only one line ... I have tried things like (.*foo.*){0}(.*bar.*){0} without enough luck.


^(?!.*(foo|bar)).*$
0

精彩评论

暂无评论...
验证码 换一张
取 消