Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

regex

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.

like image 834
benstpierre Avatar asked Dec 29 '22 11:12

benstpierre


1 Answers

/^(?!.*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.

like image 58
Amber Avatar answered Jun 02 '23 22:06

Amber