{"_id":"regexp-clone","_rev":"4082485","name":"regexp-clone","description":"Zero dependency RegExp cloning with flag and lastIndex preservation.","dist-tags":{"latest":"1.2.0"},"maintainers":[{"name":"aaron","email":"aaron.heckmann+github@gmail.com"}],"time":{"modified":"2025-11-24T21:40:06.000Z","created":"2013-04-17T21:22:45.036Z","1.2.0":"2025-08-13T21:27:49.152Z","1.1.1-1":"2025-08-13T21:23:47.206Z","1.1.0":"2025-08-13T00:31:49.453Z","1.0.0":"2019-06-07T16:16:23.962Z","0.0.1":"2013-04-17T21:22:45.036Z"},"users":{},"author":{"name":"Aaron Heckmann","email":"aaron.heckmann+github@gmail.com"},"repository":{"type":"git","url":"git://github.com/aheckmann/regexp-clone.git"},"versions":{"1.2.0":{"name":"regexp-clone","version":"1.2.0","description":"Zero dependency RegExp cloning with flag and lastIndex preservation.","main":"index.js","exports":{".":"./index.js","./package.json":"./package.json"},"types":"index.d.ts","sideEffects":false,"repository":{"type":"git","url":"git://github.com/aheckmann/regexp-clone.git"},"bugs":{"url":"https://github.com/aheckmann/regexp-clone/issues"},"keywords":["RegExp","clone"],"author":{"name":"Aaron Heckmann","email":"aaron.heckmann+github@gmail.com"},"license":"MIT","devDependencies":{"@eslint/js":"^9.33.0","@eslint/markdown":"^7.1.0","eslint":"^9.33.0","globals":"^16.3.0","jiti":"^2.5.1","prettier":"3.6.2","typescript":"^5.9.2"},"scripts":{"test":"node test/index.js","build":"tsc","fix":"pnpm run '/^(format|lint)$/'","check":"pnpm run '/.*:check$/'","format":"prettier --write --cache --cache-location .prettiercache .","format:check":"prettier --check --cache --cache-location .prettiercache .","lint":"eslint --fix --cache --cache-location .eslintcache .","lint:check":"eslint --cache --cache-location .eslintcache ."},"_id":"regexp-clone@1.2.0","homepage":"https://github.com/aheckmann/regexp-clone#readme","_integrity":"sha512-d/LEfc+joiXe4uRyuXMJcOMoqTFKS3pSZUM8WWEqoQ51tZgCdgvu/HLMWaOslhR6igkCdeuc5DULADOK16glMA==","_resolved":"/private/var/folders/m2/1dk_cvb52g9ckkkvqks61h8w0000gn/T/738f3ef652f882e9094d2421aa45f323/regexp-clone-1.2.0.tgz","_from":"file:regexp-clone-1.2.0.tgz","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"shasum":"f8d0745833f0d5ae19c0854ed99936555e34fcfc","size":2540,"noattachment":false,"key":"/regexp-clone/-/regexp-clone-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexp-clone/download/regexp-clone-1.2.0.tgz"},"_npmUser":{"name":"aaron","email":"aaron.heckmann+github@gmail.com"},"directories":{},"maintainers":[{"name":"aaron","email":"aaron.heckmann+github@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/regexp-clone_1.2.0_1755120468881_0.06163376346369276"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-08-13T21:27:49.152Z","publish_time":1755120469152,"_source_registry_name":"default","_cnpm_publish_time":1755120469152},"1.1.1-1":{"name":"regexp-clone","version":"1.1.1-1","description":"Zero dependency RegExp cloning with flag and lastIndex preservation.","main":"index.js","exports":{".":"./index.js","./package.json":"./package.json"},"types":"index.d.ts","sideEffects":false,"repository":{"type":"git","url":"git://github.com/aheckmann/regexp-clone.git"},"bugs":{"url":"https://github.com/aheckmann/regexp-clone/issues"},"keywords":["RegExp","clone"],"author":{"name":"Aaron Heckmann","email":"aaron.heckmann+github@gmail.com"},"license":"MIT","devDependencies":{"@eslint/js":"^9.33.0","@eslint/markdown":"^7.1.0","eslint":"^9.33.0","globals":"^16.3.0","jiti":"^2.5.1","prettier":"3.6.2","typescript":"^5.9.2"},"scripts":{"test":"node test/index.js","build":"tsc","fix":"pnpm run '/^(format|lint)$/'","check":"pnpm run '/.*:check$/'","format":"prettier --write --cache --cache-location .prettiercache .","format:check":"prettier --check --cache --cache-location .prettiercache .","lint":"eslint --fix --cache --cache-location .eslintcache .","lint:check":"eslint --cache --cache-location .eslintcache ."},"_id":"regexp-clone@1.1.1-1","homepage":"https://github.com/aheckmann/regexp-clone#readme","_integrity":"sha512-RHMqaUqV+jSnPiXnRkIp9rOD6/EwB9g+mpro/N/WzfugzjnzSbSUAxhfH1+MqOY2ZCO4XYZEkb91Npigoh+a5A==","_resolved":"/private/var/folders/m2/1dk_cvb52g9ckkkvqks61h8w0000gn/T/5eef057e4973bfd7e84550f9e25412b3/regexp-clone-1.1.1-1.tgz","_from":"file:regexp-clone-1.1.1-1.tgz","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"shasum":"776e56de29c456a4d6e96f371e9f6298a040fdd4","size":2544,"noattachment":false,"key":"/regexp-clone/-/regexp-clone-1.1.1-1.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexp-clone/download/regexp-clone-1.1.1-1.tgz"},"_npmUser":{"name":"aaron","email":"aaron.heckmann+github@gmail.com"},"directories":{},"maintainers":[{"name":"aaron","email":"aaron.heckmann+github@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/regexp-clone_1.1.1-1_1755120227025_0.3241767555780277"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-08-13T21:23:47.206Z","publish_time":1755120227206,"_source_registry_name":"default","_cnpm_publish_time":1755120227206},"1.1.0":{"name":"regexp-clone","version":"1.1.0","description":"Zero dependency RegExp cloning with flag and lastIndex preservation.","main":"index.js","repository":{"type":"git","url":"git://github.com/aheckmann/regexp-clone.git"},"keywords":["RegExp","clone"],"author":{"name":"Aaron Heckmann","email":"aaron.heckmann+github@gmail.com"},"license":"MIT","scripts":{"test":"node test/index.js"},"_id":"regexp-clone@1.1.0","bugs":{"url":"https://github.com/aheckmann/regexp-clone/issues"},"homepage":"https://github.com/aheckmann/regexp-clone#readme","_integrity":"sha512-M3e0XLDWAL1oO/QN6ugsvSghtXAKGj1OucHI1RaH7B7hgDXnyL7FhHqo5SGtszmb7TU4rGbIdup66GZuDE2HJQ==","_resolved":"/private/var/folders/m2/1dk_cvb52g9ckkkvqks61h8w0000gn/T/17228d08fbfee8e75ea9e912ab5ccb20/regexp-clone-1.1.0.tgz","_from":"file:regexp-clone-1.1.0.tgz","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"shasum":"9794fa710ca29e28c531e969ff049569caab57ed","size":2915,"noattachment":false,"key":"/regexp-clone/-/regexp-clone-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexp-clone/download/regexp-clone-1.1.0.tgz"},"_npmUser":{"name":"aaron","email":"aaron.heckmann+github@gmail.com"},"directories":{},"maintainers":[{"name":"aaron","email":"aaron.heckmann+github@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/regexp-clone_1.1.0_1755045109229_0.3687079840881555"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-08-13T00:31:49.453Z","publish_time":1755045109453,"_source_registry_name":"default","_cnpm_publish_time":1755045109453},"1.0.0":{"name":"regexp-clone","version":"1.0.0","description":"Clone RegExps with options","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/aheckmann/regexp-clone.git"},"keywords":["RegExp","clone"],"author":{"name":"Aaron Heckmann","email":"aaron.heckmann+github@gmail.com"},"license":"MIT","devDependencies":{"mocha":"^6.1.4"},"gitHead":"561e4dc5fe5e192a71f5a9c877f7c5b881394d5c","bugs":{"url":"https://github.com/aheckmann/regexp-clone/issues"},"homepage":"https://github.com/aheckmann/regexp-clone#readme","_id":"regexp-clone@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.11.1","_npmUser":{"name":"aaron","email":"aaron.heckmann+github@gmail.com"},"dist":{"shasum":"222db967623277056260b992626354a04ce9bf63","size":2592,"noattachment":false,"key":"/regexp-clone/-/regexp-clone-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexp-clone/download/regexp-clone-1.0.0.tgz"},"maintainers":[{"name":"aaron","email":"aaron.heckmann+github@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regexp-clone_1.0.0_1559924183831_0.5688403913827789"},"_hasShrinkwrap":false,"publish_time":1559924183962,"_cnpm_publish_time":1559924183962},"0.0.1":{"name":"regexp-clone","version":"0.0.1","description":"Clone RegExps with options","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/aheckmann/regexp-clone.git"},"keywords":["RegExp","clone"],"author":{"name":"Aaron Heckmann","email":"aaron.heckmann+github@gmail.com"},"license":"MIT","devDependencies":{"mocha":"1.8.1"},"readmeFilename":"README.md","_id":"regexp-clone@0.0.1","dist":{"shasum":"a7c2e09891fdbf38fbb10d376fb73003e68ac589","size":2145,"noattachment":false,"key":"/regexp-clone/-/regexp-clone-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexp-clone/download/regexp-clone-0.0.1.tgz"},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"aaron","email":"aaron.heckmann+github@gmail.com"},"maintainers":[{"name":"aaron","email":"aaron.heckmann+github@gmail.com"}],"directories":{},"publish_time":1366233765036,"_cnpm_publish_time":1366233765036,"_hasShrinkwrap":false}},"readme":"# regexp-clone <sup>[![Version Badge][npm-version-svg]][package-url]</sup>\n\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nZero dependency JavaScript/TypeScript `RegExp` cloner with flag and `lastIndex` preservation.\n\n## Usage\n\n```js\nconst clone = require('regexp-clone');\n\nconst a = /somethin/dgimsuy;\nconsole.log(a.global); // true\nconsole.log(a.ignoreCase); // true\nconsole.log(a.multiline); // true\nconsole.log(a.dotAll); // true\nconsole.log(a.unicode); // true\nconsole.log(a.sticky); // true\nconsole.log(a.hasIndices); // true\n\nconst b = clone(a);\nconsole.log(b.global); // true\nconsole.log(b.ignoreCase); // true\nconsole.log(b.multiline); // true\nconsole.log(b.dotAll); // true\nconsole.log(b.unicode); // true\nconsole.log(b.sticky); // true\nconsole.log(b.hasIndices); // true\n\nconst c = /hi/g;\nc.test('this string hi there');\nassert.strictEqual(c.lastIndex, 3);\n\nconst d = clone(c);\nassert.strictEqual(d.lastIndex, 3);\nd.test('this string hi there');\nassert.strictEqual(d.lastIndex, 14);\nassert.strictEqual(c.lastIndex, 3);\n```\n\n## Installation\n\n```bash\npnpm add regexp-clone\n```\n\n## Testing\n\n```bash\npnpm test\n```\n\n## License\n\n[MIT][license-url]\n\n[package-url]: https://npmjs.org/package/regexp-clone\n[npm-version-svg]: https://versionbadg.es/aheckmann/regexp-clone.svg\n[npm-badge-png]: https://nodei.co/npm/regexp-clone.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/regexp-clone.svg\n[license-url]: https://github.com/aheckmann/regexp-clone/blob/main/LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/regexp-clone.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=regexp-clone\n","_attachments":{},"homepage":"https://github.com/aheckmann/regexp-clone#readme","bugs":{"url":"https://github.com/aheckmann/regexp-clone/issues"},"license":"MIT"}