Optiver interview question

Make a Finite State Machine that parsed a simple regex