I'm writing a program like this.
const regexp = new RegExp(/* user input */);
if (message.text.match(regexp)) {
/* do something */
}
I'm afraid of ReDoS so I want to terminate the .match
calculation if it runs more than one second or something.
Is there any way to do this on Node.js?