I need to match all of its lines that contains a value and that don\'t have a given prefix.
Example: I want all lines that contains word when it\'s not pref
word
You may need
(?<!prefix )word
(and maybe take care of the spaces).
(?!) is a negative lookahead but in your case you need a negative lookbehind (i.e. (?<!)).
(?!)
(?<!)