Tools for writing a simple syntax checker?

I'm trying to write a small utility for syntax checking. I've tried using Flex/Bison, but these seem too advanced for my task. A simpler tool would be appreciated.

This is actually what I'm trying to do:

Keyword1 Keyword2 IdPrefix_IdBody_IdSuffix

I want to check that "Keyword1" is actually followed by "Keyword2" etc.
Lines like these should be rejected:

Keyword1 IdPrefix_IdBody_IdSuffix
Keyword1 Unknown IdPrefix_IdBody_IdSuffix
Keyword2 Keyword1 IdPrefix_IdBody_IdSuffix
Keyword1 Keyword2 IdBody_IdSuffix
Keyword1 Keyword2 IdPrefix_IdBody
Keyword1 Keyword2 IdPrefix_Unknown_IdSuffix

This should be a simple task, but I fail. I'd like some sort of lookahead in Flex or ability to invert match.