{"_id":"regexp.escape","_rev":"4169997","name":"regexp.escape","description":"A robust ES3-compatible polyfill for the `RegExp.escape` proposal - see https://github.com/tc39/proposal-regex-escaping","dist-tags":{"latest":"2.0.1"},"maintainers":[{"name":"ljharb","email":""}],"time":{"modified":"2026-03-01T21:12:01.000Z","created":"2015-06-13T17:57:19.199Z","2.0.1":"2024-07-09T05:32:26.336Z","2.0.0":"2024-07-09T05:29:43.363Z","1.1.0":"2020-01-13T19:26:59.083Z","1.0.2":"2015-07-21T23:27:26.582Z","1.0.1":"2015-06-13T17:59:07.962Z","1.0.0":"2015-06-13T17:57:19.199Z"},"users":{},"author":{"name":"Jordan Harband"},"repository":{"url":"git://github.com/es-shims/RegExp.escape.git","type":"git"},"versions":{"2.0.1":{"name":"regexp.escape","version":"2.0.1","keywords":["RegExp","regex","regular expression","escape","ecmascript","polyfill","shim","es-shims API"],"author":{"name":"Jordan Harband"},"license":"MIT","_id":"regexp.escape@2.0.1","maintainers":[{"name":"ljharb","email":""}],"homepage":"https://github.com/es-shims/RegExp.escape#readme","bugs":{"url":"https://github.com/es-shims/RegExp.escape/issues"},"dist":{"shasum":"09e4beef9d202dbd739868f3818223f977cf91da","size":16430,"noattachment":false,"key":"/regexp.escape/-/regexp.escape-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexp.escape/download/regexp.escape-2.0.1.tgz"},"main":"index.js","engines":{"node":">= 0.4"},"exports":{".":"./index.js","./auto":"./auto.js","./shim":"./shim.js","./polyfill":"./polyfill.js","./package.json":"./package.json","./implementation":"./implementation.js"},"funding":{"url":"https://github.com/sponsors/ljharb"},"gitHead":"0e1c2ad1b410561ea0f9b8f14905a70fa7aa68b9","scripts":{"lint":"eslint --ext=js,mjs .","test":"npm run tests-only","prelint":"evalmd README.md","prepack":"npmignore --auto --commentLines=autogenerated","pretest":"npm run lint","version":"auto-changelog && git add CHANGELOG.md","postlint":"es-shim-api --bound","posttest":"aud --production","prepublish":"not-in-publish || npm run prepublishOnly","tests-only":"nyc tape 'test/**/*.js'","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"","prepublishOnly":"safe-publish-latest"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"testling":{"files":["test/index.js","test/shimmed.js"],"browsers":["iexplore/6.0..latest","firefox/3.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"repository":{"url":"git://github.com/es-shims/RegExp.escape.git","type":"git"},"_npmVersion":"10.8.1","description":"A robust ES3-compatible polyfill for the `RegExp.escape` proposal - see https://github.com/tc39/proposal-regex-escaping","directories":{},"_nodeVersion":"22.3.0","dependencies":{"for-each":"^0.3.3","call-bind":"^1.0.7","es-errors":"^1.3.0","es-abstract":"^1.23.3","safe-regex-test":"^1.0.3","define-properties":"^1.2.1"},"publishConfig":{"ignore":[".github/workflows"]},"_hasShrinkwrap":false,"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","hideCredit":true,"unreleased":false,"commitLimit":false,"backfillLimit":false},"devDependencies":{"aud":"^2.0.4","nyc":"^10.3.2","tape":"^5.8.1","eslint":"=8.8.0","evalmd":"^0.0.19","es5-shim":"^4.6.7","es6-shim":"^0.35.8","npmignore":"^0.3.1","in-publish":"^2.0.1","@es-shims/api":"^2.5.0","auto-changelog":"^2.4.0","object-inspect":"^1.13.2","safe-publish-latest":"^2.0.0","@ljharb/eslint-config":"^21.1.1"},"_npmOperationalInternal":{"tmp":"tmp/regexp.escape_2.0.1_1720503146209_0.09165077484594875","host":"s3://npm-registry-packages"},"_cnpmcore_publish_time":"2024-07-09T05:32:26.336Z","publish_time":1720503146336,"_source_registry_name":"default","_cnpm_publish_time":1720503146336},"2.0.0":{"name":"regexp.escape","version":"2.0.0","keywords":["RegExp","regex","regular expression","escape","ecmascript","polyfill","shim","es-shims API"],"author":{"name":"Jordan Harband"},"license":"MIT","_id":"regexp.escape@2.0.0","maintainers":[{"name":"ljharb","email":""}],"homepage":"https://github.com/es-shims/RegExp.escape#readme","bugs":{"url":"https://github.com/es-shims/RegExp.escape/issues"},"dist":{"shasum":"eeddde53e3d688d1afdefa8e5cad7720cc96dc3b","size":16712,"noattachment":false,"key":"/regexp.escape/-/regexp.escape-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexp.escape/download/regexp.escape-2.0.0.tgz"},"main":"index.js","engines":{"node":">= 0.4"},"funding":{"url":"https://github.com/sponsors/ljharb"},"gitHead":"033ce84c9e1a65c59a10208e32531126e9923bb7","scripts":{"lint":"eslint --ext=js,mjs .","test":"npm run tests-only","prelint":"evalmd README.md","pretest":"npm run lint","version":"auto-changelog && git add CHANGELOG.md","postlint":"es-shim-api --bound","posttest":"aud --production","prepublish":"not-in-publish || npm run prepublishOnly","tests-only":"nyc tape 'test/**/*.js'","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"","prepublishOnly":"safe-publish-latest"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"testling":{"files":["test/index.js","test/shimmed.js"],"browsers":["iexplore/6.0..latest","firefox/3.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"repository":{"url":"git://github.com/es-shims/RegExp.escape.git","type":"git"},"_npmVersion":"10.8.1","description":"A robust ES3-compatible polyfill for the `RegExp.escape` proposal - see https://github.com/tc39/proposal-regex-escaping","directories":{},"_nodeVersion":"22.3.0","dependencies":{"for-each":"^0.3.3","call-bind":"^1.0.7","es-errors":"^1.3.0","es-abstract":"^1.23.3","safe-regex-test":"^1.0.3","define-properties":"^1.2.1"},"_hasShrinkwrap":false,"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","hideCredit":true,"unreleased":false,"commitLimit":false,"backfillLimit":false},"devDependencies":{"aud":"^2.0.4","nyc":"^10.3.2","tape":"^5.8.1","eslint":"=8.8.0","evalmd":"^0.0.19","es5-shim":"^4.6.7","es6-shim":"^0.35.8","in-publish":"^2.0.1","@es-shims/api":"^2.5.0","auto-changelog":"^2.4.0","object-inspect":"^1.13.2","safe-publish-latest":"^2.0.0","@ljharb/eslint-config":"^21.1.1"},"_npmOperationalInternal":{"tmp":"tmp/regexp.escape_2.0.0_1720502983137_0.7001702923604092","host":"s3://npm-registry-packages"},"deprecated":"please use v2.0.1+. v2.0.0 omitted the `exports` field","_cnpmcore_publish_time":"2024-07-09T05:29:43.363Z","publish_time":1720502983363,"_source_registry_name":"default","_cnpm_publish_time":1720502983363},"1.1.0":{"name":"regexp.escape","version":"1.1.0","author":{"name":"Jordan Harband"},"funding":{"url":"https://github.com/sponsors/ljharb"},"description":"A robust ES3-compatible polyfill for the ES7 `RegExp.escape` proposal - see https://github.com/benjamingr/RexExp.escape/","license":"MIT","main":"index.js","scripts":{"prepublish":"safe-publish-latest","pretest":"npm run lint","pretests-only":"es-shim-api --bound","tests-only":"npm run test:shimmed && npm run test:module","test":"npm run tests-only","posttest":"npx aud","test:shimmed":"node --es-staging test/shimmed","test:module":"node --es-staging test","coverage":"covert test/*.js","lint":"eslint .","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"repository":{"type":"git","url":"git://github.com/es-shims/regexp.escape.git"},"keywords":["RegExp","regex","regular expression","escape","ES7","ecmascript","polyfill","shim","es-shims API"],"dependencies":{"define-properties":"^1.1.3","es-abstract":"^1.17.0","function-bind":"^1.1.1"},"devDependencies":{"@es-shims/api":"^2.1.2","@ljharb/eslint-config":"^15.1.0","auto-changelog":"^1.16.2","covert":"^1.1.1","es5-shim":"^4.5.13","es6-shim":"^0.35.5","eslint":"^6.8.0","foreach":"^2.0.5","safe-publish-latest":"^1.1.4","tape":"^5.0.0-next.3"},"testling":{"files":["test/index.js","test/shimmed.js"],"browsers":["iexplore/6.0..latest","firefox/3.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"engines":{"node":">= 0.4"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false},"gitHead":"fda97f601c1ddb97d5a9c3cdda0c213ff4ef3a7b","bugs":{"url":"https://github.com/es-shims/regexp.escape/issues"},"homepage":"https://github.com/es-shims/regexp.escape#readme","_id":"regexp.escape@1.1.0","_nodeVersion":"13.6.0","_npmVersion":"6.13.4","dist":{"shasum":"521924caaf35b1c01c5bce7ab72914b79101c967","size":6353,"noattachment":false,"key":"/regexp.escape/-/regexp.escape-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexp.escape/download/regexp.escape-1.1.0.tgz"},"maintainers":[{"name":"ljharb","email":""}],"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regexp.escape_1.1.0_1578943618963_0.6246612421149345"},"_hasShrinkwrap":false,"publish_time":1578943619083,"_cnpm_publish_time":1578943619083},"1.0.2":{"name":"regexp.escape","version":"1.0.2","author":{"name":"Jordan Harband"},"description":"A robust ES3-compatible polyfill for the ES7 `RegExp.escape` proposal - see https://github.com/benjamingr/RexExp.escape/","license":"MIT","main":"index.js","scripts":{"test":"npm run lint && npm run test:shimmed && npm run test:module && npm run security","test:shimmed":"node --es-staging test/shimmed.js","test:module":"node --es-staging test/index.js","coverage":"covert test/*.js","coverage-quiet":"covert test/*.js --quiet","lint":"npm run jscs && npm run eslint","jscs":"jscs test/*.js *.js","eslint":"eslint test/*.js *.js","security":"nsp package"},"repository":{"type":"git","url":"git://github.com/ljharb/regexp.escape.git"},"keywords":["RegExp","regex","regular expression","escape","ES7","ecmascript","polyfill","shim"],"dependencies":{"define-properties":"^1.1.1","es-abstract":"^1.2.1","function-bind":"^1.0.2"},"devDependencies":{"tape":"^4.0.1","covert":"^1.1.0","jscs":"^1.13.1","nsp":"^1.0.3","eslint":"^1.0.0-rc-1","semver":"^5.0.1","replace":"^0.3.0","es5-shim":"^4.1.10","es6-shim":"^0.32.2","foreach":"^2.0.5"},"testling":{"files":["test/index.js","test/shimmed.js"],"browsers":["iexplore/6.0..latest","firefox/3.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"engines":{"node":">= 0.4"},"gitHead":"907e9bdf1a4dae34147b3bfcfa98f1cb527bfb76","bugs":{"url":"https://github.com/ljharb/regexp.escape/issues"},"homepage":"https://github.com/ljharb/regexp.escape#readme","_id":"regexp.escape@1.0.2","_shasum":"bcbb6ffe9490ad81b9ef6e9672a18f2a01ba41a0","_from":".","_npmVersion":"2.13.0","_nodeVersion":"2.4.0","_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"dist":{"shasum":"bcbb6ffe9490ad81b9ef6e9672a18f2a01ba41a0","size":8194,"noattachment":false,"key":"/regexp.escape/-/regexp.escape-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexp.escape/download/regexp.escape-1.0.2.tgz"},"maintainers":[{"name":"ljharb","email":""}],"directories":{},"publish_time":1437521246582,"_cnpm_publish_time":1437521246582,"_hasShrinkwrap":false},"1.0.1":{"name":"regexp.escape","version":"1.0.1","author":{"name":"Jordan Harband"},"description":"A robust ES3-compatible polyfill for the ES7 `RegExp.escape` proposal - see https://github.com/benjamingr/RexExp.escape/","license":"MIT","main":"index.js","scripts":{"test":"npm run lint && npm run test:shimmed && npm run test:module && npm run security","test:shimmed":"node --es-staging test/shimmed.js","test:module":"node --es-staging test/index.js","coverage":"covert test/*.js","coverage-quiet":"covert test/*.js --quiet","lint":"npm run jscs && npm run eslint","jscs":"jscs test/*.js *.js","eslint":"eslint test/*.js *.js","security":"nsp package"},"repository":{"type":"git","url":"git://github.com/ljharb/regexp.escape.git"},"keywords":["RegExp","regex","regular expression","escape","ES7","ecmascript","polyfill","shim"],"dependencies":{"define-properties":"^1.0.2","es-abstract":"^1.2.1","function-bind":"^1.0.2","string-at":"^1.0.1"},"devDependencies":{"tape":"^4.0.0","covert":"^1.1.0","jscs":"^1.13.1","nsp":"^1.0.1","eslint":"^0.22.1","semver":"^4.3.6","replace":"^0.3.0","es5-shim":"^4.1.6","es6-shim":"^0.32.0","foreach":"^2.0.5"},"testling":{"files":["test/index.js","test/shimmed.js"],"browsers":["iexplore/6.0..latest","firefox/3.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"engines":{"node":">= 0.4"},"gitHead":"359e541e3a85f86e48243fe17a4f7419f92066e6","bugs":{"url":"https://github.com/ljharb/regexp.escape/issues"},"homepage":"https://github.com/ljharb/regexp.escape#readme","_id":"regexp.escape@1.0.1","_shasum":"66fcf9cd192958e84da81f6c7175eb49564dfda4","_from":".","_npmVersion":"2.11.1","_nodeVersion":"2.3.0","_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"dist":{"shasum":"66fcf9cd192958e84da81f6c7175eb49564dfda4","size":7925,"noattachment":false,"key":"/regexp.escape/-/regexp.escape-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexp.escape/download/regexp.escape-1.0.1.tgz"},"maintainers":[{"name":"ljharb","email":""}],"directories":{},"publish_time":1434218347962,"_cnpm_publish_time":1434218347962,"_hasShrinkwrap":false},"1.0.0":{"name":"regexp.escape","version":"1.0.0","author":{"name":"Jordan Harband"},"description":"A robust ES3-compatible polyfill for the ES7 `RegExp.escape` proposal - see https://github.com/benjamingr/RexExp.escape/","license":"MIT","main":"index.js","scripts":{"test":"npm run lint && npm run test:shimmed && npm run test:module && npm run security","test:shimmed":"node --es-staging test/shimmed.js","test:module":"node --es-staging test/index.js","coverage":"covert test/*.js","coverage-quiet":"covert test/*.js --quiet","lint":"npm run jscs && npm run eslint","jscs":"jscs test/*.js *.js","eslint":"eslint test/*.js *.js","security":"nsp package"},"repository":{"type":"git","url":"git://github.com/ljharb/regexp.escape.git"},"keywords":["RegExp","regex","regular expression","escape","ES7","ecmascript","polyfill","shim"],"dependencies":{"define-properties":"^1.0.2","es-abstract":"^1.2.1","function-bind":"^1.0.2","string-at":"^1.0.1"},"devDependencies":{"tape":"^4.0.0","covert":"^1.1.0","jscs":"^1.13.1","nsp":"^1.0.1","eslint":"^0.22.1","semver":"^4.3.6","replace":"^0.3.0","es5-shim":"^4.1.6","es6-shim":"^0.32.0","foreach":"^2.0.5"},"testling":{"files":["test/index.js","test/shimmed.js"],"browsers":["iexplore/6.0..latest","firefox/3.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"engines":{"node":">= 0.4"},"gitHead":"e341b23078e3b6ac5cd8398fef3ce722cf4b129c","bugs":{"url":"https://github.com/ljharb/regexp.escape/issues"},"homepage":"https://github.com/ljharb/regexp.escape#readme","_id":"regexp.escape@1.0.0","_shasum":"462cac4b0609e247a14b5833280d32358e748381","_from":".","_npmVersion":"2.11.1","_nodeVersion":"2.3.0","_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"dist":{"shasum":"462cac4b0609e247a14b5833280d32358e748381","size":7899,"noattachment":false,"key":"/regexp.escape/-/regexp.escape-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexp.escape/download/regexp.escape-1.0.0.tgz"},"maintainers":[{"name":"ljharb","email":""}],"directories":{},"publish_time":1434218239199,"_cnpm_publish_time":1434218239199,"_hasShrinkwrap":false}},"readme":"# regexp.escape <sup>[![Version Badge][npm-version-svg]][package-url]</sup>\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nA robust & optimized ES3-compatible polyfill for [the `RegExp.escape` proposal](https://github.com/tc39/proposal-regex-escaping).\n\nUse it to safely escape RegExp special tokens for use in `new RegExp`.\n\nUse it as a standalone function, or call its `shim` method to install it as a polyfill.\n\n## Example\n\n```js\nvar escape = require('regexp.escape');\nvar assert = require('assert');\n\nvar str = 'hello. how are you?';\nvar regex = new RegExp('^' + escape(str) + '$');\nassert.match(str, regex);\nassert.doesNotMatch('hello, how are you!', regex);\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/regexp.escape\n[npm-version-svg]: https://versionbadg.es/es-shims/RegExp.escape.svg\n[deps-svg]: https://david-dm.org/es-shims/RegExp.escape.svg\n[deps-url]: https://david-dm.org/es-shims/RegExp.escape\n[dev-deps-svg]: https://david-dm.org/es-shims/RegExp.escape/dev-status.svg\n[dev-deps-url]: https://david-dm.org/es-shims/RegExp.escape#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/regexp.escape.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/regexp.escape.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/regexp.escape.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=regexp.escape\n[codecov-image]: https://codecov.io/gh/es-shims/RegExp.escape/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/es-shims/RegExp.escape/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/RegExp.escape\n[actions-url]: https://github.com/es-shims/RegExp.escape/actions\n","_attachments":{},"homepage":"https://github.com/es-shims/RegExp.escape#readme","bugs":{"url":"https://github.com/es-shims/RegExp.escape/issues"},"license":"MIT"}