You will note the FSM solution delegates to some info on a table to figure it out and uses functions where it can't figure it out (i.e: a value that is dynamic, such as a color, instead of checking all colors, we just ask the browser if it's valid)
The regexp version has a couple deffiencies from a full FSM version in that it can't branch or parse from different states, for example if it encounters "color" it can't tell to just search for "colors" in the next regexp
1. "the square AND circle" You're going to need NLP or some dirtier parsing to do this 2. You will have to implement things other than "color" on your own but it should be easy enough to do