Fix StateMachine regex

Java regex are greedy ....