Here is a regex that works fine in most regex implementations:
(?
This matches .js for a string which ends with .js exc
Let's suppose you want to find all int
not preceded by unsigned
:
With support for negative look-behind:
(?
Without support for negative look-behind:
((?!unsigned ).{9}|^.{0,8})int
Basically idea is to grab n preceding characters and exclude match with negative look-ahead, but also match the cases where there's no preceeding n characters. (where n is length of look-behind).
So the regex in question:
(?
would translate to:
((?!filename).{8}|^.{0,7})\.js$
You might need to play with capturing groups to find exact spot of the string that interests you or you want't to replace specific part with something else.