Detect possibly exponential-time regular expressions, thanks to safe-regex with cli support
Install through NPM
npm install safer-regex
or
git clone git://github.com/hex7c0/safer-regex.git
inside nodejs project
var safe = require('safer-regex');
safe('(a+){2}y');
regex
- String RegExp source that you want to check (required)exception
- Boolean Raise Exception if True or return Boolean value (default "raise")
Install through NPM
npm install -g safer-regex
global cli with -g
option
$ safer-regex -h
Usage:
safer-regex [OPTIONS] [ARGS]
Options:
-v, --version Display the current version
-h, --help Display help and usage details
Take a look at my examples