{"name":"safe-regex2","version":"3.0.0","description":"detect possibly catastrophic, exponential-time regular expressions","main":"index.js","dependencies":{"ret":"~0.4.0"},"devDependencies":{"standard":"^17.0.0","tape":"^5.0.0"},"scripts":{"test":"standard && tape test/*.js"},"repository":{"type":"git","url":"git://github.com/fastify/safe-regex.git"},"homepage":"https://github.com/fastify/safe-regex","keywords":["catastrophic","exponential","regex","safe","sandbox"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"contributors":[{"name":"Matteo Collina","email":"hello@matteocollina.com"}],"license":"MIT","gitHead":"77f3de04dc2744a50f53a315772dbd60d63b9799","bugs":{"url":"https://github.com/fastify/safe-regex/issues"},"_id":"safe-regex2@3.0.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-vPp34BbeSYdHPcRAhre+XA0qX2+zDCiaXExoANPVu4yNZGD0QS+/TsmTeHKdPJCSPS6Ap3Hrb6T6f5wlvpvJzw==","shasum":"822e04bed41d564024be55c3338eeb38c9d27aa5","tarball":"http://registry-npm.ywwl.com/safe-regex2/download/safe-regex2-3.0.0.tgz","fileCount":9,"unpackedSize":6500,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTgTbE8J6i6JMZqWELnoKGHJMlfASQsmTzw/chWKwdEAIgdaJFD+S17aHzRdwMMXUyH79n1nF6emhMvSr+ytlysoo="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJijgU2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqS9A/+MOkD0sAMY+Fy9LXYYBvpsPdPiozoiwWIbz9vIaEY2zMtpDfr\r\n3rfxXVtaKbwdUqK8owZkz+hFjnKl0BWmYIEKUHFjlTDyzFKi7naLnQwpJ5Wg\r\nb0Zz6iANLn9pchYSPwKZjlOWUJm07EBXO6ohZ/E4YfFVilVGuYZ1CVpCykWT\r\nutAlCiYzQ/vLVmXa9p3G5baYZKKlvlwSSPoLpbBcAM2Qnh18ZiYhImyeKVqg\r\n296yWtJ1h0Au+e5hExQdAfedD666B4RJZem7RwcTbTLwyR0LuA0cy+QJXIzA\r\n883aLCXLnrCwqlwDmPhiAvO/895SmnbjnUfxrC5s1L+goI3V9BFBNhJn8vhH\r\nureJ7vU9Fpp/CI0VJcvlSLJY0HAVoF4561dbRyXdqvd9w2tYyUgsag8X2pOm\r\nugKdLz6dhUhkEXhTqWxNwVLGgGozld2ASQkRmcDg4NRSiOSzHb69mtwIkzNY\r\nnyPTr9N5inAmdAsSs/FXvR8JeKrhrKmbA2jExHg6atIOc6lMOngjfCNPghP5\r\n6Sqh/bIhgcVeEqueeOeWQyXJWzfZu+bPxpj9wyd2+49pm5PHNcmdDGeTtT+f\r\n2/Xzf5VXMPUxjF6zY9rKkhIvTeQXmsoi2St3tGR+obfzJ0rBTlsPQc5I6bIg\r\njJbkx5MRAocONdqrsylC0TWULT4R4DQIT/o=\r\n=Regr\r\n-----END PGP SIGNATURE-----\r\n","size":3261,"noattachment":false,"key":"/safe-regex2/-/safe-regex2-3.0.0.tgz"},"_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"directories":{},"maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/safe-regex2_3.0.0_1653474613933_0.325470533541957"},"_hasShrinkwrap":false,"readme":"# safe-regex2\n\ndetect potentially\n[catastrophic](http://regular-expressions.mobi/catastrophic.html)\n[exponential-time](http://perlgeek.de/blog-en/perl-tips/in-search-of-an-exponetial-regexp.html)\nregular expressions by limiting the\n[star height](https://en.wikipedia.org/wiki/Star_height) to 1\n\nThis is a fork of https://github.com/substack/safe-regex at 1.1.0.\n\nWARNING: This module has both false positives and false negatives.\nIt is not meant as a full checker, but it detect basic cases.\n\n# example\n\n``` js\nvar safe = require('safe-regex2');\nvar regex = process.argv.slice(2).join(' ');\nconsole.log(safe(regex));\n```\n\n```\n$ node safe.js '(x+x+)+y'\nfalse\n$ node safe.js '(beep|boop)*'\ntrue\n$ node safe.js '(a+){10}'\nfalse\n$ node safe.js '\\blocation\\s*:[^:\\n]+\\b(Oakland|San Francisco)\\b'\ntrue\n```\n\n# methods\n\n``` js\nvar safe = require('safe-regex')\n```\n\n## var ok = safe(re, opts={})\n\nReturn a boolean `ok` whether or not the regex `re` is safe and not possibly\ncatastrophic.\n\n`re` can be a `RegExp` object or just a string.\n\nIf the `re` is a string and is an invalid regex, returns `false`.\n\n* `opts.limit` - maximum number of allowed repetitions in the entire regex.\nDefault: `25`.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install safe-regex2\n```\n\n# license\n\nMIT\n","publish_time":1653474614103,"_cnpm_publish_time":1653474614103,"dist-tags":{"latest":"5.1.2"}}