I’m working on some performance code at work to get regular expressions faster. Part of this is that I also have to catch slow regular expressions. In the current system we do this with an alarm() in perl (it has to bypass safe signals because by default Perl won’t interrupt a regexp with an alarm() due to it being unsafe).
However the regular expression libraries I’m working with (pcre and re2) have clever systems for stopping execution of slow regular expressions, and so I cannot make my alarm fire. This makes testing that I’ve got this working awfully difficult!
Damn you libraries, why do you have to be so clever!