The syntax feels a little rough although I have no ideas how to make it better:
Regexp.timeout = 1.0
...
/^a*b?a*$/ =~ "a" * 50000 + "x"
I think I would favor the: long_time_re = Regexp.new("^a*b?a*$", timeout: 1.0)
version instead but I use the `=~` almost entirely, so that would still be a big style change. Probably end up setting a global timeout per app and then overriding for individual checks as needed?