Fixed regexp simulation.