{"_id":"utils-regex-from-string","_rev":"4087166","name":"utils-regex-from-string","description":"Parses a regular expression string and returns a new regular expression.","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"time":{"modified":"2025-12-02T22:11:47.000Z","created":"2015-08-26T15:35:00.909Z","1.0.0":"2015-08-26T15:35:24.781Z","0.0.0":"2015-08-26T15:35:00.909Z"},"users":{},"author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"repository":{"type":"git","url":"git://github.com/kgryte/utils-regex-from-string.git"},"versions":{"1.0.0":{"name":"utils-regex-from-string","version":"1.0.0","description":"Parses a regular expression string and returns a new regular expression.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec","codecov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/codecov/coverage --report lcovonly -- -R spec && cat ./reports/codecov/coverage/lcov.info | codecov && rm -rf ./reports/codecov"},"main":"./lib","repository":{"type":"git","url":"git://github.com/kgryte/utils-regex-from-string.git"},"keywords":["util","utils","utility","utilities","regular","expression","regex","regexp","string"],"bugs":{"url":"https://github.com/kgryte/utils-regex-from-string/issues"},"dependencies":{"regex-regex":"^1.0.0","validate.io-string-primitive":"^1.0.0"},"devDependencies":{"chai":"3.x.x","codecov.io":"^0.1.5","istanbul":"^0.3.0","jshint":"2.x.x","jshint-stylish":"2.x.x","mocha":"2.x.x"},"license":"MIT","gitHead":"33e473778aecd8900d5e00b0f65a05d70f5ffe06","homepage":"https://github.com/kgryte/utils-regex-from-string#readme","_id":"utils-regex-from-string@1.0.0","_shasum":"fe1a2909f8de0ff0d5182c80fbc654d6a687d189","_from":".","_npmVersion":"2.8.3","_nodeVersion":"0.12.7","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"shasum":"fe1a2909f8de0ff0d5182c80fbc654d6a687d189","size":2693,"noattachment":false,"key":"/utils-regex-from-string/-/utils-regex-from-string-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/utils-regex-from-string/download/utils-regex-from-string-1.0.0.tgz"},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"directories":{},"publish_time":1440603324781,"_hasShrinkwrap":false,"_cnpm_publish_time":1440603324781,"_cnpmcore_publish_time":"2021-12-17T01:24:50.138Z"},"0.0.0":{"name":"utils-regex-from-string","version":"0.0.0","description":"Parses a regular expression string and returns a new regular expression.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec","codecov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/codecov/coverage --report lcovonly -- -R spec && cat ./reports/codecov/coverage/lcov.info | codecov && rm -rf ./reports/codecov"},"main":"./lib","repository":{"type":"git","url":"git://github.com/kgryte/utils-regex-from-string.git"},"keywords":["util","utils","utility","utilities","regular","expression","regex","regexp","string"],"bugs":{"url":"https://github.com/kgryte/utils-regex-from-string/issues"},"dependencies":{"regex-regex":"^1.0.0","validate.io-string-primitive":"^1.0.0"},"devDependencies":{"chai":"3.x.x","codecov.io":"^0.1.5","istanbul":"^0.3.0","jshint":"2.x.x","jshint-stylish":"2.x.x","mocha":"2.x.x"},"license":"MIT","gitHead":"18a854207f20139e6188ad189aeff30080f68726","homepage":"https://github.com/kgryte/utils-regex-from-string#readme","_id":"utils-regex-from-string@0.0.0","_shasum":"9dbea83a88ae753066a8ffbd0cf56b38bc4c0923","_from":".","_npmVersion":"2.8.3","_nodeVersion":"0.12.7","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"shasum":"9dbea83a88ae753066a8ffbd0cf56b38bc4c0923","size":2695,"noattachment":false,"key":"/utils-regex-from-string/-/utils-regex-from-string-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/utils-regex-from-string/download/utils-regex-from-string-0.0.0.tgz"},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"directories":{},"publish_time":1440603300909,"_hasShrinkwrap":false,"_cnpm_publish_time":1440603300909,"_cnpmcore_publish_time":"2021-12-17T01:24:50.354Z"}},"readme":"RegExp\n===\n[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependencies][dependencies-image]][dependencies-url]\n\n> Parses a [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) string and returns a new [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions).\n\n\n## Installation\n\n``` bash\n$ npm install utils-regex-from-string\n```\n\n\n## Usage\n\n``` javascript\nvar regex = require( 'utils-regex-from-string' );\n```\n\n#### regex( str )\n\nParses a [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) `string` and returns a new [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions).\n\n``` javascript\nvar re = regex( '/beep/' )\n// returns /beep/\n```\n\n__Note__: provided `strings` must be properly __escaped__.\n\n``` javascript\n// Unescaped:\nre = regex( '/\\w+/' );\n// returns /w+/\n\n// Escaped:\nre = regex( '/\\\\w+/' );\n// returns /\\w+/\n```\n\n\n## Examples\n\n``` javascript\nvar regex = require( 'utils-regex-from-string' );\n\nconsole.log( regex( '/beep/' ) );\n// returns /beep/\n\nconsole.log( regex( '/[A-Z]*/' ) );\n// returns /[A-Z]*/\n\nconsole.log( regex( '/\\\\\\\\\\\\\\//ig' ) );\n// returns /\\\\\\//ig\n\nconsole.log( regex( '/[A-Z]{0,}/' ) );\n// returns /[A-Z]{0,}/\n\nconsole.log( regex( '/^boop$/' ) );\n// returns /^boop$/\n\nconsole.log( regex( '/(?:.*)/' ) );\n// returns /(?:.*)/\n\nconsole.log( regex( '/(?:beep|boop)/' ) );\n// returns /(?:beep|boop)/\n\nconsole.log( regex( '/\\\\w+/' ) );\n// returns /\\w+/\n```\n\nTo run the example code from the top-level application directory,\n\n``` bash\n$ node ./examples/index.js\n```\n\n\n## Tests\n\n### Unit\n\nUnit tests use the [Mocha](http://mochajs.org/) test framework with [Chai](http://chaijs.com) assertions. To run the tests, execute the following command in the top-level application directory:\n\n``` bash\n$ make test\n```\n\nAll new feature development should have corresponding unit tests to validate correct functionality.\n\n\n### Test Coverage\n\nThis repository uses [Istanbul](https://github.com/gotwarlost/istanbul) as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:\n\n``` bash\n$ make test-cov\n```\n\nIstanbul creates a `./reports/coverage` directory. To access an HTML version of the report,\n\n``` bash\n$ make view-cov\n```\n\n\n---\n## License\n\n[MIT license](http://opensource.org/licenses/MIT).\n\n\n## Copyright\n\nCopyright &copy; 2015. Athan Reines.\n\n\n[npm-image]: http://img.shields.io/npm/v/utils-regex-from-string.svg\n[npm-url]: https://npmjs.org/package/utils-regex-from-string\n\n[travis-image]: http://img.shields.io/travis/kgryte/utils-regex-from-string/master.svg\n[travis-url]: https://travis-ci.org/kgryte/utils-regex-from-string\n\n[codecov-image]: https://img.shields.io/codecov/c/github/kgryte/utils-regex-from-string/master.svg\n[codecov-url]: https://codecov.io/github/kgryte/utils-regex-from-string?branch=master\n\n[dependencies-image]: http://img.shields.io/david/kgryte/utils-regex-from-string.svg\n[dependencies-url]: https://david-dm.org/kgryte/utils-regex-from-string\n\n[dev-dependencies-image]: http://img.shields.io/david/dev/kgryte/utils-regex-from-string.svg\n[dev-dependencies-url]: https://david-dm.org/dev/kgryte/utils-regex-from-string\n\n[github-issues-image]: http://img.shields.io/github/issues/kgryte/utils-regex-from-string.svg\n[github-issues-url]: https://github.com/kgryte/utils-regex-from-string/issues\n","_attachments":{},"homepage":"https://github.com/kgryte/utils-regex-from-string#readme","bugs":{"url":"https://github.com/kgryte/utils-regex-from-string/issues"},"license":"MIT"}