Please tell us a bit about your background with scripting.
This is very easy to do so, but the way you ask the question suggests you don't have the basic familiarity, in which case it may be very very hard for you.
Just search for one word, and then if and only if you find it, search for the next word. If you find the second word, then they were both there. If not, they were not.