Never parse a data file with regex or string functions. Always spend the small extra time to at least write a state machine.
Unless you have some nice way to quickly create a state machine besides using regexes?
The trouble with most simple regexes to solve this, is the state machine is often not closed.
A regex is way better than strcmp, ltrim, rtrim, mid and friends all held together with gum and tape.