deterministic finite automata string search