Skip to content

Make a regular expression time out if it takes too long to execute

License

Notifications You must be signed in to change notification settings

elonehoo/regex-timer

Repository files navigation

regex-timer

Make a regular expression time out if it takes too long to execute

Install

#npm
npm install @elonehoo/regex-timer
# yarn
yarn add @elonehoo/regex-timer
#pnpm
pnpm install @elonehoo/regex-timer

Usage

import {isMatch} from '@elonehoo/regex-timer'

console.log(isMatch(/\d+/, getUserInput(), {timeout: 1000}))

About

Make a regular expression time out if it takes too long to execute

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published