Do all regular expressions halt?
问题 Is there any regular expression that will, for some input string, search for a match forever? 回答1: For a finite input, there is no formal regular expression that will not halt. Any formal regular expression can be translated into a Deterministic Finite Automata. A DFA reads the input one character at a time, and, at the end of the input, you are either in an accepting state or in a non-accepting state. If the state is accepting, then the input matches the regular expression. Otherwise, it