DFAs for simple regexp equality test and arithmetics expression parsing