Pathological regular expressions can execute in geometric time.
for handling regular expressions.
In mode 0, all regular expressions are disabled and throw an error. This is safe and works in every environment.
In mode 1, all regular expressions are executed natively. This is potentially unsafe and works in every environment.
In mode 2, all regular expressions are executed in a separate environment. In web browsers this means asynchronously in a Web Worker thread, in Node.js this means synchronously in a VM. If a regular expression takes more than REGEXP_THREAD_TIMEOUT (default 1000 ms) then it is terminated and an error thrown. This is safe and works in most environments. If Web Workers or VM is not supported (meaning IE 9 or IE 10), then all regular expressions throw an error.
Back to the JS-Interpreter documentation.