4

I know there are many posts about timeout for the regex and that regex should be written well, but you know: regex are obscure art and sometime it can happen that a regex on certain texts use a lot of time.

Other languages like C# have a Timeout property for the Regex execution and I am wondering why Python 3 seems to not have the same approach.

Internally Python 3 have a sort of maximum time of execution, because after a long time the regex abort and the execution go ahead. Is it true?

I would like to analyze that question on python 3 and to use a platform independent approach (I saw decorator that work only on NIX OSs with Signals...)

Maybe the answer is to manage this problem using a more general approach on how to stop function in Python, like in enter link description here or enter link description here

Have Anyone updated ideas about that problem?

thanks a lot

Community
  • 1
  • 1
robob
  • 1,630
  • 4
  • 22
  • 42
  • 1
    Isn't it a dupe of [How to timeout function in python, timeout less than a second](http://stackoverflow.com/questions/11901328/how-to-timeout-function-in-python-timeout-less-than-a-second)? – Wiktor Stribiżew Mar 29 '17 at 06:14
  • 2
    No because in the solution there is a decorator that is system dependent. Moreover the post is not clear on what version of python regards. Maybe in python 3 there is a different approach. – robob Mar 29 '17 at 06:39

0 Answers0