Why does Regexp have a timeout method, while in theory they shouldn't?
问题 This is a theoretical Computer Science question (Computation Theory). I know that RegExps can take a very long time to calculate. However, from Theory of Computation we know that matching with a Regular Expression can be done extremely fast in a few clock cycles. If RegExps are equivalent to Finite Automata, why RegExps have (or require) a timeout method? Using a DFA, the computation time for matching can be exteremely fast. By RegExps I mean the Regular Expressions pattern matching classes