开发者

Match all Strings without the word "authorize" in them [duplicate]

开发者 https://www.devze.com 2023-01-05 23:22 出处:网络
This question already has answers here: 开发者_Go百科 Closed 12 years ago. Possible Duplicate: Java \\ Pattern - how to write a pattern that verifies the lack of a string?
This question already has answers here: 开发者_Go百科 Closed 12 years ago.

Possible Duplicate:

Java \ Pattern - how to write a pattern that verifies the lack of a string?

How can I match all strings without the word "authorize" in them via regular expressions? I tried *(authorize){0}* to no avail.


/^(?!.*authorize).*/

This uses a negative lookahead to ensure that the overall pattern will match only if the expression "authorize" cannot match anywhere in the input.

0

精彩评论

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