Regex: Matching by exclusion, without look-ahead – is it possible?
UPDATE: It fails “with two ff before oo” as @Ciantic pointed out in the comments. ^(f(o[^o]|[^o])|[^f])*$ NOTE: It is much much easier just to negate a match on the client side instead of using the above regex. The regex assumes that each line ends with a newline char if it is not then see C++’s … Read more