0
output = System.Text.RegularExpressions.Regex.Replace(output, "(?s).*/th>(.*?)<tr class=""summaryrow"">", "$1") + "<end>"

I already forget what it's supposed to do. How can regular expression never finish?

What does it try to accomplish? Perhaps I can replace that with strReplace

seanmus
  • 508
  • 2
  • 15
user4951
  • 32,206
  • 53
  • 172
  • 282
  • 2
    Any time you can match most of the pattern several different ways and fail at the end, you get a potential for combinatorial explosion, usually called "catastrophic backtracking". I guess the input has many `` and ` – Amadan Feb 24 '16 at 05:30
  • what does (?s) match? – user4951 Feb 24 '16 at 05:32
  • this code use to run fast. not sure what happened. the input is some html document. I am trying to extract the table. – user4951 Feb 24 '16 at 05:33
  • This could be a stupid question. I write that regular expression. I forget what ?s should match. What does (?s) should match? – user4951 Feb 24 '16 at 13:36
  • `(?s)` enables [single-line mode](https://msdn.microsoft.com/en-us/library/yd1hzczs(v=vs.110).aspx#Singleline). It does not match anything, it is transparent. – Amadan Feb 29 '16 at 05:33

0 Answers0