https://github.com/hex7c0/safer-regex
detect possibly exponential-time regular expressions (with cli support)
https://github.com/hex7c0/safer-regex
cli nodejs regex regular-expression
Last synced: 30 days ago
JSON representation
detect possibly exponential-time regular expressions (with cli support)
- Host: GitHub
- URL: https://github.com/hex7c0/safer-regex
- Owner: hex7c0
- License: gpl-3.0
- Created: 2016-09-16T18:18:41.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-04-17T11:55:01.000Z (about 2 years ago)
- Last Synced: 2025-06-02T16:33:31.017Z (about 1 month ago)
- Topics: cli, nodejs, regex, regular-expression
- Language: JavaScript
- Homepage: https://github.com/hex7c0/safer-regex
- Size: 57.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# [safer-regex](https://github.com/hex7c0/safer-regex)
[](https://www.npmjs.com/package/safer-regex)
[](https://travis-ci.org/hex7c0/safer-regex)
[](https://ci.appveyor.com/project/hex7c0/safer-regex)
[](https://david-dm.org/hex7c0/safer-regex)
[](https://coveralls.io/r/hex7c0/safer-regex)Detect possibly exponential-time regular expressions, thanks to [safe-regex](https://github.com/substack/safe-regex) with cli support
## Dev Installation
Install through NPM
```bash
npm install safer-regex
```
or
```bash
git clone git://github.com/hex7c0/safer-regex.git
```## API
inside nodejs project
```js
var safe = require('safer-regex');safe('(a+){2}y');
```### safe(regex [, exception])
#### options
- `regex` - **String** RegExp source that you want to check *(required)*
- `exception`- **Boolean** Raise Exception if True or return Boolean value *(default "raise")*## Console Installation
Install through NPM
```bash
npm install -g safer-regex
```## API
global cli with `-g` option
```bash
$ safer-regex -hUsage:
safer-regex [OPTIONS] [ARGS]Options:
-v, --version Display the current version
-h, --help Display help and usage details
```## Examples
Take a look at my [examples](examples)
### [License GPLv3](LICENSE)