string detection simple grammar