dfa matcher of the substrings