The inverted version of the native JavaScript RegExp object.
Install the module with: npm install regexp-inverse
var RegExpInverse = require('regexp-inverse');
var regExp = new RegExpInverse('.*');
regExp.test('foobar'); # Returns false
This is a very simple module, that just reverses the outputs of the JavaScript RegExp object. So if the RegExp object matches something, regexp-inverse doesn't and vice versa.
When you use the exec-method of the object and the original RegExp wouldn't match, regexp-inverse returns an array containing the input text.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Copyright (c) 2016 Dennis Ploeger
Licensed under the MIT license.