开发者

Neither-nor oneline REGEXP

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜