Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-04-17T11:55:01.000Z (over 1 year ago)
- Last Synced: 2024-04-25T12:03:06.748Z (8 months ago)
- Topics: cli, nodejs, regex, regular-expression
- Language: JavaScript
- Homepage: https://github.com/hex7c0/safer-regex
- Size: 57.6 KB
- Stars: 2
- Watchers: 2
- 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)
[![NPM version](https://img.shields.io/npm/v/safer-regex.svg)](https://www.npmjs.com/package/safer-regex)
[![Linux Status](https://img.shields.io/travis/hex7c0/safer-regex.svg?label=linux-osx)](https://travis-ci.org/hex7c0/safer-regex)
[![Windows Status](https://img.shields.io/appveyor/ci/hex7c0/safer-regex.svg?label=windows)](https://ci.appveyor.com/project/hex7c0/safer-regex)
[![Dependency Status](https://img.shields.io/david/hex7c0/safer-regex.svg)](https://david-dm.org/hex7c0/safer-regex)
[![Coveralls](https://img.shields.io/coveralls/hex7c0/safer-regex.svg)](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)