{"_id":"@jsbits/escape-regex-str","_rev":"4-15aa2eb34f66ddd1a94fb4a255d51c8c","name":"@jsbits/escape-regex-str","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@jsbits/escape-regex-str","version":"1.0.0","description":"Escapes special characters in a string, for matching substrings with a RegExp instance.","license":"BSD-2-Clause","main":"./index.js","module":"esm/index.js","es2015":"index.mjs","esnext":"index.mjs","browser":"umd/index.js","source":"index.ts","types":"index.d.ts","engines":{"node":">=4.2"},"author":{"name":"@aMarCruz"},"bugs":{"url":"https://github.com/ProJSLib/jsbits/issues"},"homepage":"https://github.com/ProJSLib/jsbits","repository":{"type":"git","url":"git+https://github.com/ProJSLib/jsbits.git"},"_id":"@jsbits/escape-regex-str@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"amarcruz","email":"amarcruz@yahoo.com"},"dist":{"integrity":"sha512-+z46sOOyR6HyUFOwzn2MpW3RoYTyx+X4ktLMUBDNzbwSUY4H9Ucp+3nh+sWMWgTE83X0bGk7ElnjGUr6QpaNLA==","shasum":"626e62ec1a745cf85fe21d573497593f777fade5","tarball":"https://registry.npmjs.org/@jsbits/escape-regex-str/-/escape-regex-str-1.0.0.tgz","fileCount":15,"unpackedSize":11385,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5T5uCRA9TVsSAnZWagAA2tkQAJ1458gFNupjSPlR0zAG\nIQc1Q4zfTnEqCuNjmPp1xkxYmpHwHcBdarSgp9118mQBy7DqJWdJgKJosss6\n+kbOjtA22YiDVpKFu020AqWOVLxdLzwHHDDXpzeY/ik90uoqGsWa5vGtzgr9\n1AETRdR6WYRXGobBoWLBhGUbwqeD3U+BPXszdl1akbwmlDNgF5JRaXH9ds0K\nXd+WZn63eZ3z7AXFKQLuGUz/5M1t8bBZIl+96dzZtkHyIfbmKZM2A5aMX6zl\nyik4USzDVGCydykRLwMEQgs5vvZPnCxEN9yuPFR9HoFcg26Jxs6ud6KhIvFY\nTpL0voJoSt0Gc7Xg+QNLjITItNVkWk+28So6P+a+eykwj1gx4NMhA2a5n9l8\niRETJNaAxi7zQaEQUYmOjSpkdXfQ+H6RssM8/Wj/ZucqsxVy9XxD5/KOiNxR\nsbOl4MA4BY4s0Nu6PT+rehgK6mvumVH4CZ+nLz35c3WAg1uYHOeYZ+r6hja0\nqP1WZ8xdSAsdzEfUC7X51xICNnJmQJAnsuT9dVTclvQOY78MeamvFzpaPuGe\nEN+FWbV+ogdhrk5Fzp16Ny9XvnlIx1JYZVTVlIf8/kWQK/7zgNxEbBGvS1lg\nhW7jznp1Q6GXorjAA3JCqnciK7hiqAK0cHlncUJS+ay3srfvHDgoLswHhF06\ndKMu\r\n=qdyN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHRtxWSjISob0q3BLjG/t46X2fQs++4NtlqGZqEiAbnqAiBa6auLCTU3S/Yx45yLD84wTOr1X6i4xE9XWKxA5jo59w=="}]},"maintainers":[{"name":"amarcruz","email":"amarcruz@yahoo.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-regex-str_1.0.0_1541750381874_0.4254248819351347"},"_hasShrinkwrap":false},"1.0.1":{"name":"@jsbits/escape-regex-str","version":"1.0.1","description":"Escapes special characters in a string, for matching substrings with a RegExp instance.","license":"BSD-2-Clause","main":"./index.js","module":"esm/index.js","es2015":"index.mjs","esnext":"index.mjs","browser":"umd/index.js","source":"index.ts","types":"index.d.ts","engines":{"node":">=4.2"},"author":{"name":"@aMarCruz"},"bugs":{"url":"https://github.com/ProJSLib/jsbits/issues"},"homepage":"https://github.com/ProJSLib/jsbits","repository":{"type":"git","url":"git+https://github.com/ProJSLib/jsbits.git"},"_id":"@jsbits/escape-regex-str@1.0.1","scripts":{},"_shasum":"903d8915cba5377585a1db54f29f5f1ad8978572","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.14.0","_npmUser":{"name":"amarcruz","email":"amarcruz@yahoo.com"},"dist":{"shasum":"903d8915cba5377585a1db54f29f5f1ad8978572","tarball":"https://registry.npmjs.org/@jsbits/escape-regex-str/-/escape-regex-str-1.0.1.tgz","integrity":"sha512-MwIJ+9zOZ3T9eYegO1FN1lxhss8P0Z+vw2rh36bhjwfzsYA4ByP2EXnwcCWmJlqcSVvxVdSa0wdZkWk7TxCcsw==","fileCount":16,"unpackedSize":12746,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6bY2CRA9TVsSAnZWagAAWZUP/jT6AUtMDQv4mQuho/VY\nwq/f5s+2D7vHAQ8g7W+Tr2x7MN15HcuA1UuS9Yy1saLMT4dk9+n+/4s7Ikr5\ndtdExphW4xGcx7nWCRV/Lii0qkT8Tk9EHr5wD6nArkZ5zrPu5PTef6prAFao\nbXR+GPI7DGO6zPq7sYVsAkb/cbsufAkqf0LCRPh2GyyDKCgIRndWO9ulu/wl\nnSvKyzDtsAXrcrydzFMklLe4E+o264rvIskznPh/Iscr5X7z4OnvStI41YyI\nmg5X8lT1V3/V8je57Fltz3kYKq7Pl7qyta+e4+ExAm4sf0U62tYTANWoJ9Nt\naNsQt2XwNEG2IkNgZlUaJdzhDotHOmT5TbTJqeCM0KV7J3MPkgiry2LCutge\n/wM72NTAqucriJneObWBqVMZmkVRE4S97kZRZ9XCrpIvfTMtIfEzTuy/d+9b\nJuUnATTA9TgpMUKHnlQn1C57A22oEXgwj00qR4g8zFJT35AzRJVrluiY0uOY\nrVifSejLizKi+JAQoJBgi0QoTI4bsQlPn5c/Ti8Y4GiETAgduBA47icyKYPb\nZ6KePcfFnPRzRKDAjiAB6BIGnrZxV9sSPEv47rAadO6+nWDOw8I6sC64zIVu\nfZurAwRbC78eNnjv1dVx8giFJi0XgOvpOnMrQBe9UYfqVwNQ3cIvC2c6Uu96\nqYVM\r\n=QZ2D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIATsRU2T9lgcdP1u8pMYQh+HbG4W+wUarrhbKsq2eCTAAiBTyZlEaR0X9YlTNLzEvjrDU1KbmR9oYPExXd+vV79Ktw=="}]},"maintainers":[{"name":"amarcruz","email":"amarcruz@yahoo.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-regex-str_1.0.1_1542043189303_0.9503843326850079"},"_hasShrinkwrap":false},"1.0.2":{"name":"@jsbits/escape-regex-str","version":"1.0.2","description":"Escapes special characters in a string, for matching substrings with a RegExp instance.","license":"BSD-2-Clause","main":"./index.js","module":"esm/index.js","es2015":"index.mjs","esnext":"index.mjs","browser":"umd/index.js","source":"index.ts","types":"index.d.ts","engines":{"node":">=4.2"},"author":{"name":"@aMarCruz"},"bugs":{"url":"https://github.com/ProJSLib/jsbits/issues"},"homepage":"https://github.com/ProJSLib/jsbits","repository":{"type":"git","url":"git+https://github.com/ProJSLib/jsbits.git"},"scripts":{"lint":"eslint --ext js .","pretest":"tsc","test":"mocha test/index.spec.ts"},"devDependencies":{"@types/expect.js":"^0.3.29","@types/mocha":"^5.2.5","expect.js":"^0.3.1","mocha":"^5.2.0","ts-node":"^7.0.1","typescript":"~3.2.1"},"keywords":["javascript","typescript","es6","escape","regexp","string","parsing","parse"],"_id":"@jsbits/escape-regex-str@1.0.2","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"amarcruz","email":"amarcruz@yahoo.com"},"dist":{"integrity":"sha512-PjVQVWa2YqStLDUucQFUHptytUy4zrw/U1T8PCX/Ut/gBnNRS8N2y47nqi+1uAYkGzX5orPNv4A5KReoctnBXg==","shasum":"df29d4a4cda6bae9246e9daeee9558b5cfa09859","tarball":"https://registry.npmjs.org/@jsbits/escape-regex-str/-/escape-regex-str-1.0.2.tgz","fileCount":17,"unpackedSize":15260,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCgMzCRA9TVsSAnZWagAASWcP/1REUvyEDrhAz6kTFVx1\nwvdBmEkdKRJjQOoNK2Yun1jVhUdWO/nQWA9XnIC4YlmknJHxsPHroOy5ZC5o\nNpvvjeld+JG/l80Blasr48CoQCI+4Ie7D5cfdRPdpuvPugGgz3uI9kKQ0+5h\n/PtjJbGdvX/k4/FrSpyv996p9OAX67ZEW0I87dpZTkuvj4L6YDg2h4SOPAnd\n/PMnJLlpL6+gcQxF3SwMbS2gakHysbsTY+ceoE+scMt8Ewg7i9API5iQm9Xf\nT0+qWL9fDqVPUFsBV/tnSlXtCOcLhoEgwXTJfWG1F4Mq3IGvn/o4amYLHuXq\n6cpZ1tvT+KlSIXCHxoIvdCvYbyE6LNu/p9usFjNR+MNnmBynWNw/qdtz432/\nXTT9kpUiv1TDQYbMjJmtx59+qJhxVI3IEKFjiZ/dhwBUJhQlbY4lumZUV+hP\nQYr3kvdFdkbDSWRSWv/S1eaOqrJKl+GL4LBD0uP6XKZYtbgrj/OT0lXloOKe\nMTAFjYeq13l6kQvYZNcaHeIiYWi9o+8dZ0OF8r9X19xpveZqGnKpnqAQSTDu\npDTr8JWvDW+Cuf5JSaM5oreCJYthuMEPtk9YVePQWKT18P9Rlk79ZG2L2deT\n0L4Kl1f47+c1/cP7AFgY4IFbc7lPL1Zm8wfwpLsN0zoShNdgnP441w3b6ahH\n7Rh+\r\n=5+lc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICBxLrzRqlRPdUBJCbNEhgu9c76nk2Q35C/Fd5MHi0xyAiAi7nLl8TIbWtvcijQ1bBGlD3uEohr7nGC0bVuzyLxAXA=="}]},"maintainers":[{"name":"amarcruz","email":"amarcruz@yahoo.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-regex-str_1.0.2_1544160050206_0.7184554549138706"},"_hasShrinkwrap":false},"1.0.3":{"name":"@jsbits/escape-regex-str","version":"1.0.3","description":"Escapes special characters in a string, for matching substrings with a RegExp instance.","license":"MIT","main":"./index.js","module":"esm/index.js","es2015":"index.mjs","esnext":"index.mjs","browser":"umd/index.js","source":"index.ts","types":"index.d.ts","engines":{"node":">=4.2"},"author":{"name":"aMarCruz"},"bugs":{"url":"https://github.com/ProJSLib/jsbits/issues"},"homepage":"https://github.com/ProJSLib/jsbits","repository":{"type":"git","url":"git+https://github.com/ProJSLib/jsbits.git"},"scripts":{"lint":"eslint --ext js .","pretest":"tsc","test":"mocha test/index.spec.ts"},"devDependencies":{"@types/expect.js":"^0.3.29","@types/mocha":"^5.2.5","expect.js":"^0.3.1","mocha":"^5.2.0","ts-node":"^7.0.1","typescript":"~3.2.2"},"keywords":["javascript","typescript","es6","escape","regexp","string","parsing","parse"],"_id":"@jsbits/escape-regex-str@1.0.3","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"amarcruz","email":"amarcruz@yahoo.com"},"dist":{"integrity":"sha512-0800vYI2fg1nuUq/T9Tqv8DMOLLNiRAltxFbKIbR7szrvW6qTuI2+zGK51hV7NAAmUr4G83Kvpj2R6Yyg07iIw==","shasum":"d35a2d21dfdc81a0e5ebeb68b6a16e17ca36ad20","tarball":"https://registry.npmjs.org/@jsbits/escape-regex-str/-/escape-regex-str-1.0.3.tgz","fileCount":17,"unpackedSize":14553,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcJ4EUCRA9TVsSAnZWagAATBYP/3p732F39MPfHuTXgIVg\n8g3phlmFMxiRcMS8EF2WLeW8Gu/d/RbgZ3RFdVYbHo15eloYkX8MVAY3sBFG\nAAtnLh+xpzFjiJIfnX6ZINOZ2PQ5eajWtB1LYstc1UETX8wYTdUqeeIfma4z\njBsnQIprTINnXmalJMJ30RxmAG+7P7UzX+ibiNTYqhENjbSLNVLR3eRXas0v\nCjSFSLu3xUg6KBgJHnsG14OaLZBgaNlfdMoDNUBgUacdC04QKosTzDP31/Kd\nSxaPqiYEiidxz1QCkcXS4ZbQr8fOw9B7qwnmyEm6uTvS4EgVHj0nwO7bnlzO\nsRk7BI+hze66w6ceMJ4u58rk5J8Q4kacODTkodSDUHMVpblczDvhQkBRUB9A\nly2gOaH/S1RG5UC0gCjW/CjpdneGZNOmAD818ELWWEDpEoUU+k85uTox0cGr\nE3+5RIBEdT0m7EOA+LNs836IL1S26AhSHhM3P6t8gFD8VbO6v+LNF4U4T8kq\nKfK8gxV6ouml+qaJbnWZUjhjpuKPaLe1uWfCCRdu5noaqjb8HXps3kockyo0\nEXQB/ChxADMtBZUTaLFLHkh6bQkEcS8V2bOqj9D0+mJRjMiHF49Z5dFK2dhj\n+pc+ihPGxE1iBxViBN78SEqW2raH5qBKrnt1x5IskWC/vcn5YfnY1cY5TTkO\n8tae\r\n=CCFT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH4Cc7Oqklff3oyG47IXSwXnaEmOuB3jE/U2rhlgD37fAiEAq5vLyz5irpmqnsiyODaCDlwWXrykjJGovvlCpODIJ3Q="}]},"maintainers":[{"name":"amarcruz","email":"amarcruz@yahoo.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-regex-str_1.0.3_1546092820208_0.7447816395537292"},"_hasShrinkwrap":false}},"time":{"created":"2018-11-09T07:59:41.705Z","1.0.0":"2018-11-09T07:59:42.007Z","modified":"2022-04-05T22:30:31.655Z","1.0.1":"2018-11-12T17:19:49.403Z","1.0.2":"2018-12-07T05:20:50.407Z","1.0.3":"2018-12-29T14:13:40.343Z"},"maintainers":[{"name":"amarcruz","email":"amarcruz@yahoo.com"}],"description":"Escapes special characters in a string, for matching substrings with a RegExp instance.","homepage":"https://github.com/ProJSLib/jsbits","repository":{"type":"git","url":"git+https://github.com/ProJSLib/jsbits.git"},"author":{"name":"aMarCruz"},"bugs":{"url":"https://github.com/ProJSLib/jsbits/issues"},"license":"MIT","readme":"# @jsbits/escape-regex-str\n\n_Part of the [JSBits][jsbits-url] suite._\n\n[![License][license-badge]](LICENSE)\n[![npm Version][npm-badge]][npm-url]\n[![minified size][size-badge]][size-url]<br>\n[![AppVeyor Test][appveyor-badge]][appveyor-url]\n[![Travis Test][travis-badge]][travis-url]\n[![coverage][codecov-badge]][codecov-url]\n[![code quality][codacy-badge]][codacy-url]\n[![maintainability][climate-badge]][climate-url]\n\nEscapes special characters in a string, for matching substrings with a RegExp instance.\n\n## Install\n\nFor NodeJS and JS bundlers:\n\n```bash\nnpm i @jsbits/escape-regex-str\n# or\nyarn add @jsbits/escape-regex-str\n```\n\nor load `escapeRegexStr` in the browser:\n\n```html\n<script src=\"https://unpkg.com/@jsbits/escape-regex-str/index.b.min.js\"></script>\n```\n\n### Targets\n\n- ES5 compatible browser\n- NodeJS v4.2 or later\n\n## `escapeRegexStr(str)` ⇒ `string` \n\nEscapes special characters in a given string in preparation to be used as\nargument of the JS `RegExp` constructor, useful when you want to match the\ngiven string as a literal substring.\n\n| Param | Type | Description |\n| --- | --- | --- |\n| str | `string` | A string. |\n\n**Returns**: `string` - The escaped string.  \n\nSince 1.0.0<br>\nGroup: dev<br>\nAuthor/Maintainer: aMarCruz<br>\n\n### Example\n\n```ts\nimport escapeRegexStr from '@jsbits/escape-regex-str'\n\nconst sourceStr = 'Unicorn (white): $'\n\n// without escapeRegexStr, the test fails.\nconst regex1 = new RegExp(sourceStr)\nconsole.log(regex1.test('Unicorn (white): $1.00')) // ⇒ false\n\n// with escapeRegexStr, it succeeds.\nconst regex2 = new RegExp(escapeRegexStr(sourceStr))\nconsole.log(regex2.test('Unicorn (white): $1.00')) // ⇒ true\n```\n\n## Imports\n\nAll the [JSBits][jsbits-url] functions works in _strict mode_ and are compatible with:\n\n- ES5 browsers, through the [jQuery](https://jquery.com/) `$.jsbits` object or the global `jsbits`.\n- ESM Bundlers, like [webpack](http://webpack.github.io/) and [Rollup](https://rollupjs.org/).\n- [ES modules](http://2ality.com/2014/09/es6-modules-final.html) for modern browsers or NodeJS with the `--experimental-modules` flag.\n- [CommonJS](https://nodejs.org/docs/latest/api/modules.html#modules_modules) modules of NodeJS, jspm, and others.\n- [Babel](https://babeljs.io/) and [TypeScript](www.typescriptlang.org/), through ES Module Interop.\n\nPlease see the [Distribution Formats][jsbits-formats] in the JSBits README to know about all the variants.\n\n## Support my Work\n\nI'm a full-stack developer with more than 20 year of experience and I try to share most of my work for free and help others, but this takes a significant amount of time and effort so, if you like my work, please consider...\n\n[<img src=\"https://amarcruz.github.io/images/kofi_blue.png\" height=\"36\" title=\"Support Me on Ko-fi\" />][kofi-url]\n\nOf course, feedback, PRs, and stars are also welcome 🙃\n\nThanks for your support!\n\n## License\n\nThe [MIT](LICENSE) License.\n\n&copy; 2018-2019 Alberto Martínez &ndash; Readme powered by [jscc](https://github.com/aMarCruz/jscc) and [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown)\n\n[license-badge]:  https://img.shields.io/badge/license-MIT-blue.svg?style=flat\n[npm-badge]:      https://img.shields.io/npm/v/@jsbits/escape-regex-str.svg\n[npm-url]:        https://www.npmjs.com/package/@jsbits/escape-regex-str\n[appveyor-badge]: https://img.shields.io/appveyor/ci/aMarCruz/jsbits/master.svg?label=appveyor\n[appveyor-url]:   https://ci.appveyor.com/project/aMarCruz/jsbits/branch/master\n[travis-badge]:   https://img.shields.io/travis/ProJSLib/jsbits/master.svg?label=travis\n[travis-url]:     https://travis-ci.org/ProJSLib/jsbits\n[codecov-badge]:  https://img.shields.io/codecov/c/github/ProJSLib/jsbits/master.svg\n[codecov-url]:    https://codecov.io/gh/ProJSLib/jsbits/branch/master\n[codacy-badge]:   https://img.shields.io/codacy/grade/b9374fca91d64b75aafac26682df8fd0/master.svg\n[codacy-url]:     https://www.codacy.com/app/ProJSLib/jsbits?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=ProJSLib/jsbits&amp;utm_campaign=Badge_Grade\n[climate-badge]:  https://img.shields.io/codeclimate/maintainability/ProJSLib/jsbits.svg\n[climate-url]:    https://codeclimate.com/github/ProJSLib/jsbits/maintainability\n[size-badge]:     https://img.shields.io/bundlephobia/min/@jsbits/escape-regex-str.svg\n[size-url]:       https://bundlephobia.com/result?p=@jsbits/escape-regex-str\n[jsbits-url]:     https://github.com/ProJSLib/jsbits\n[jsbits-formats]: https://github.com/ProJSLib/jsbits#distribution-formats\n[kofi-url]:       https://ko-fi.com/C0C7LF7I\n","readmeFilename":"README.md","keywords":["javascript","typescript","es6","escape","regexp","string","parsing","parse"]}