{"name":"safe-regex2","version":"2.0.0","description":"detect possibly catastrophic, exponential-time regular expressions","main":"index.js","dependencies":{"ret":"~0.2.0"},"devDependencies":{"standard":"^12.0.1","tape":"^4.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":"6af6b35b1609474d928a5e9a8af4f95ab6771628","bugs":{"url":"https://github.com/fastify/safe-regex/issues"},"_id":"safe-regex2@2.0.0","_nodeVersion":"10.15.1","_npmVersion":"6.7.0","_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"dist":{"integrity":"sha512-PaUSFsUaNNuKwkBijoAPHAK6/eM6VirvyPWlZ7BAQy4D+hCvh4B6lIG+nPdhbFfIbP+gTGBcrdsOaUs0F+ZBOQ==","shasum":"b287524c397c7a2994470367e0185e1916b1f5b9","tarball":"http://registry-npm.ywwl.com/safe-regex2/download/safe-regex2-2.0.0.tgz","fileCount":7,"unpackedSize":5388,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcakVUCRA9TVsSAnZWagAA6NMP+wZOiGTaV3JrxZ/ao+fA\n06rLysYy9JbifFF9/4xqRIcKU9kxykAlaqkYDNMdU/zkBAbezcRkAPglHAm0\ntTYDmVipp8AOnJWbezWJM7Kl26AIgE5UVyeH9XcB4/0W3uwNf17F5m5jy4mL\nFhsbG75sACdmRAZR+nP0RRLq2oT54QicUdBT3OR8QWx2hlPldYbbdq/6veUM\n7geBkcODQ0lspjOiuxQmQcZqvuwxgVvubYGWLdeaBRogYlV78JQSom6hdoCc\n2lNri78qaOZh+KYbKMOtdpNaSffr95XGUR4ueRMQayBS40Sj1gHjVb0B3Z+i\nPZ7fDpHJI0HVXHbYwVjiy5imepey6jJ9IRpsxGM7mWAqYPwJbmxVBXHxJpxg\nR+I2IndDBBwqphsoZTxNzza7V7eb2rtC/AMeYbNQmoNg037S6dygr1cf3GyG\nxnKzV2r9X9hxqIUoZpVCcdJR+14lGIUUKEHxsDY+SwA2hMjnkC3nNq0SyfJF\ny4r82qW5egaxg1DOd1Oxl73OH322MjmfRuQjHxGPJ1N28uJeFHkAqGoI21mN\nwtgw0g4dA/wi288KNiobBNoWry2lSCPPK2nOytskxB01Lb6B1bE7To+Y8Rj7\nB/nIM3bJLhTSBYs+NLEDxt3zclWCWTLMDF5gpcpOycPZC0I2GlWpMQSJ88tr\nOkBu\r\n=Sk2m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDXXYxN4ltsoXg+zvNedBUrZX1pE66HaAkmjDlJ1NN4SAiEAnYs7WWwAkoG6jwsVqiSpUrwmmbGhmrupk7a2J3o6KbU="}],"size":2778,"noattachment":false,"key":"/safe-regex2/-/safe-regex2-2.0.0.tgz"},"maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/safe-regex2_2.0.0_1550468435646_0.20697473603543237"},"_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":1550468435761,"_cnpm_publish_time":1550468435761,"dist-tags":{"latest":"5.1.2"}}