import re

negations = ["no", "not"]
words = ["text", "sample text", "text book", "notebook"]
sentences = [
	"first sentence with no and sample text",
	"second with a text but also a not",
	"third has a no, a text and a not",
	"fourth alone is what is neeeded with just text",
	"keep putting line here no"
] 

for sentence in sentences:
	negationsRegex = re.compile(r"\b(?:" + "|".join([re.escape(n) for n in negations]) + r")\b")
	wordsRegex = re.compile(r"\b(?:" + "|".join([re.escape(w) for w in words]) + r")\b")
	if not (re.search(negationsRegex, sentence) and re.search(wordsRegex, sentence)):
		print sentence