I need a regular expression that would match the word "foo" in the second sentence, but not in the first two. The criteria would be that "foo" can only be matched if it is not followed by any of several words. In this example they filter words might be "sentence" and/or "question". The filter word might immediately precede the match word, but if it occurs in the previous sentence it should not be considered.
This sentence has a the word foo in it. This bar, also has foo. Does this question have "foo" in it?
I tried the following, but it always matches "foo". Given that a negative lookbehind may not be able to contain a regex, is this even possible. It will run in the .Net Regex engine.