The question Complexity of Regex substitution nears the question, but it is not the same. According to the reply by theprise, the complexity (of a DFA engine) is:
O(2^m + n) [where m is the length of the regex and n is the length of the string]
The red book "Algorithm Design Manual" on page 15-16 discusses the time for different algorithms. According to it, when the length of the algorithm is over 1,000,000, the algorithm of O(m^2) is hopeless. It takes 16.7 minutes to process, assuming the operation time of one nano second.
The statement in the book augmented my interest. Can you do a 1,000,000 characters long Regex under 16.7 minutes' processing time? Can you do a catastrophic Regex and the processing time still hold? I really doubt it.
What is the longest possible Regex with the operation time of one nano second in the polynomial time?