Make a regular expression time out if it takes too long to execute
#npm
npm install @elonehoo/regex-timer
# yarn
yarn add @elonehoo/regex-timer
#pnpm
pnpm install @elonehoo/regex-timer
import {isMatch} from '@elonehoo/regex-timer'
console.log(isMatch(/\d+/, getUserInput(), {timeout: 1000}))