{"_id":"@putout/operator-regexp","_rev":"4158890","name":"@putout/operator-regexp","description":"🐊Putout operator adds ability to check if provided regexp can be converted to string without losing it's sense","dist-tags":{"latest":"4.0.0"},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"time":{"modified":"2026-03-01T20:33:25.000Z","created":"2021-10-03T13:12:25.405Z","4.0.0":"2026-01-03T11:57:00.578Z","3.0.0":"2025-12-07T16:54:30.451Z","2.0.0":"2025-08-15T23:33:47.117Z","1.0.0":"2021-10-03T13:12:25.405Z"},"users":{},"author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"repository":{"type":"git","url":"git+https://github.com/coderaiser/putout.git"},"versions":{"4.0.0":{"name":"@putout/operator-regexp","version":"4.0.0","type":"module","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout operator adds ability to check if provided regexp can be converted to string without losing it's sense","homepage":"https://github.com/coderaiser/putout/tree/master/packages/operator-regexp#readme","main":"lib/regexp.js","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git+https://github.com/coderaiser/putout.git"},"scripts":{"test":"madrun test","watch:test":"madrun watch:test","lint":"madrun lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","fix:lint":"madrun fix:lint","coverage":"madrun coverage","report":"madrun report"},"dependencies":{"regexp-tree":"^0.1.24"},"keywords":["putout","putout-operator","operator","regexp"],"devDependencies":{"@putout/test":"^15.0.0","c8":"^10.0.0","eslint":"^10.0.0-alpha.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^29.0.0","madrun":"^12.0.0","montag":"^1.2.1","nodemon":"^3.0.1","supertape":"^11.0.3","try-catch":"^4.0.0"},"peerDependencies":{"putout":">=41"},"license":"MIT","engines":{"node":">=22"},"publishConfig":{"access":"public"},"_id":"@putout/operator-regexp@4.0.0","gitHead":"d86b9c1ec0c89998435077456e30a62ed56548df","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"25.2.1","_npmVersion":"11.4.2","dist":{"shasum":"3d3d80afce9319025f9271ac4e0f18bca0698a00","size":2516,"noattachment":false,"key":"/@putout/operator-regexp/-/@putout/operator-regexp-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@putout/operator-regexp/download/@putout/operator-regexp-4.0.0.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/operator-regexp_4.0.0_1767441420431_0.7910891348624249"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-03T11:57:00.578Z","publish_time":1767441420578,"_source_registry_name":"default","_cnpm_publish_time":1767441420578},"3.0.0":{"name":"@putout/operator-regexp","version":"3.0.0","type":"commonjs","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout operator adds ability to check if provided regexp can be converted to string without losing it's sense","homepage":"https://github.com/coderaiser/putout/tree/master/packages/operator-regexp#readme","main":"lib/regexp.js","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git+https://github.com/coderaiser/putout.git"},"scripts":{"test":"madrun test","watch:test":"madrun watch:test","lint":"madrun lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","fix:lint":"madrun fix:lint","coverage":"madrun coverage","report":"madrun report"},"dependencies":{"regexp-tree":"^0.1.24"},"keywords":["putout","putout-operator","operator","regexp"],"devDependencies":{"@putout/test":"^14.0.0","c8":"^10.0.0","eslint":"v10.0.0-alpha.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^29.0.0","madrun":"^11.0.0","montag":"^1.2.1","nodemon":"^3.0.1","supertape":"^11.0.3","try-catch":"^3.0.1"},"peerDependencies":{"putout":">=41"},"license":"MIT","engines":{"node":">=20"},"publishConfig":{"access":"public"},"_id":"@putout/operator-regexp@3.0.0","gitHead":"5b736cae8973be82ea62ef08659a0bc03b9b6898","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"25.2.1","_npmVersion":"11.4.2","dist":{"shasum":"3eda41f4cdf787cb56d18df0fd80cd18e0762b77","size":2528,"noattachment":false,"key":"/@putout/operator-regexp/-/@putout/operator-regexp-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@putout/operator-regexp/download/@putout/operator-regexp-3.0.0.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/operator-regexp_3.0.0_1765126470302_0.716768928189216"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-12-07T16:54:30.451Z","publish_time":1765126470451,"_source_registry_name":"default","_cnpm_publish_time":1765126470451},"2.0.0":{"name":"@putout/operator-regexp","version":"2.0.0","type":"commonjs","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout operator adds ability to check if provided regexp can be converted to string without losing it's sense","homepage":"https://github.com/coderaiser/putout/tree/master/packages/operator-regexp#readme","main":"lib/regexp.js","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git+https://github.com/coderaiser/putout.git"},"scripts":{"test":"madrun test","watch:test":"madrun watch:test","lint":"madrun lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","fix:lint":"madrun fix:lint","coverage":"madrun coverage","report":"madrun report"},"dependencies":{"regexp-tree":"^0.1.24"},"keywords":["putout","putout-operator","operator","regexp"],"devDependencies":{"@putout/eslint-flat":"^3.0.0","@putout/test":"^14.0.0","c8":"^10.0.0","eslint":"^9.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^28.0.0","madrun":"^11.0.0","montag":"^1.2.1","nodemon":"^3.0.1","supertape":"^11.0.3"},"peerDependencies":{"putout":">=40"},"license":"MIT","engines":{"node":">=20"},"publishConfig":{"access":"public"},"_id":"@putout/operator-regexp@2.0.0","gitHead":"04ff0f30b63f57cb3ea16ebbb757b24244507bd5","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"24.5.0","_npmVersion":"11.4.2","dist":{"shasum":"fe1a599a8953879dbe8fd1776709450598c9e9e3","size":2435,"noattachment":false,"key":"/@putout/operator-regexp/-/@putout/operator-regexp-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@putout/operator-regexp/download/@putout/operator-regexp-2.0.0.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/operator-regexp_2.0.0_1755300826911_0.2504907722981746"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-08-15T23:33:47.117Z","publish_time":1755300827117,"_source_registry_name":"default","_cnpm_publish_time":1755300827117},"1.0.0":{"name":"@putout/operator-regexp","version":"1.0.0","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"putout operator adds ability to check if provided regexp can be converted to string without loosing it's sense","homepage":"https://github.com/coderaiser/putout/tree/master/packages/operator-regexp#readme","main":"lib/regexp.js","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git://github.com/coderaiser/putout.git"},"scripts":{"test":"madrun test","watch:test":"madrun watch:test","lint":"madrun lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","fix:lint":"madrun fix:lint","coverage":"madrun coverage","report":"madrun report"},"dependencies":{"regexp-tree":"^0.1.24"},"keywords":["putout","putout-operator","operator","regexp"],"devDependencies":{"@putout/test":"^3.0.0","c8":"^7.5.0","eslint":"^8.0.0-beta.0","eslint-plugin-node":"^11.0.0","eslint-plugin-putout":"^10.0.0","lerna":"^4.0.0","madrun":"^8.0.1","montag":"^1.2.1","nodemon":"^2.0.1","supertape":"^6.7.2"},"peerDependencies":{"putout":">=20"},"license":"MIT","engines":{"node":">=14"},"publishConfig":{"access":"public"},"gitHead":"484fbbf4804b7fed4f99351c17de397993cbfecf","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_id":"@putout/operator-regexp@1.0.0","_nodeVersion":"16.10.0","_npmVersion":"7.24.0","dist":{"shasum":"faf224e8d4bf29a4dc9f53b41d1261aef6c41968","size":2181,"noattachment":false,"key":"/@putout/operator-regexp/-/@putout/operator-regexp-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@putout/operator-regexp/download/@putout/operator-regexp-1.0.0.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/operator-regexp_1.0.0_1633266745239_0.0002230715987532328"},"_hasShrinkwrap":false,"publish_time":1633266745405,"_cnpm_publish_time":1633266745405,"_cnpmcore_publish_time":"2021-12-16T21:05:20.300Z"}},"readme":"# @putout/operator-regexp [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/operator-regexp.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/operator-regexp \"npm\"\n\n????[**Putout**](https://github.com/coderaiser/putout) operator adds ability to determine that provided [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) can be\nconverted to [`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) without losing it's sense.\n\nIt is used for example in [regexp/convert-replace-to-relace-all](https://github.com/coderaiser/putout/tree/master/packages/plugin-regexp#regexpconvert-replace-to-replace-all):\n\n```diff\n-'hello'.replace(/hello/g, 'world');\n+'hello'.replaceAll('hello', 'world');\n```\n\n## Install\n\n```\nnpm i putout @putout/operator-regexp\n```\n\n## API\n\n### isSimpleRegexp(regexp: RegExp)\n\n```js\nconst {operator} = require('putout');\nconst {isSimpleRegExp} = operator;\n\nisSimpleRegExp(/hello world/);\n// returns\ntrue;\n\nisSimpleRegExp(/^hello/);\n// returns\nfalse;\n```\n\n### transformRegExp(regexp: String, plugin: Traverser)\n\n```js\ntransformRegExp('[aab]', {\n    report,\n    fix,\n    traverse,\n});\n```\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/coderaiser/putout/tree/master/packages/operator-regexp#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"license":"MIT"}