{"name":"cidr-regex","version":"3.0.0","description":"Regular expression for matching IP addresses in CIDR notation","author":{"name":"silverwind","email":"me@silverwind.io"},"contributors":[{"name":"Felipe Apostol","email":"flipjs.io@gmail.com","url":"http://flipjs.io/"}],"repository":{"type":"git","url":"git+https://github.com/silverwind/cidr-regex.git"},"license":"BSD-2-Clause","scripts":{"test":"make test"},"engines":{"node":">=10"},"keywords":["cidr","regex","notation","cidr notation","prefix","prefixes","ip","ip address"],"dependencies":{"ip-regex":"^4.1.0"},"devDependencies":{"eslint":"7.0.0","eslint-config-silverwind":"13.1.0","jest":"26.0.1","updates":"10.2.11","versions":"8.2.9"},"gitHead":"8e047680b63311923807ff897f53c10b9b4a322f","bugs":{"url":"https://github.com/silverwind/cidr-regex/issues"},"homepage":"https://github.com/silverwind/cidr-regex#readme","_id":"cidr-regex@3.0.0","_nodeVersion":"14.1.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-HjIwpv3Lc/bkn7jQfgDUfs8o3ksRx6uManpALGZ1zqHjxo3CjLrXvNZ7P2EmftJAp3es+mGI6tEaAWECngEwwA==","shasum":"3e6771a98ec2535c4ccc6f1591808e5ee01bcbbf","tarball":"http://registry-npm.ywwl.com/cidr-regex/download/cidr-regex-3.0.0.tgz","fileCount":4,"unpackedSize":4280,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevD6kCRA9TVsSAnZWagAA0lwQAIbaUtYgcABWZmi5zw9s\n7v9xFRCgtsnVzUnrByHlXtqbYPjAri2jQxC/6CTUQClrh58Mrvuz92zyKhmb\n2UG/OwUJr3yNedn5I5sMexm2liuvyfiaqsD7BcR05Gne8PHkxLdTWM6anoQc\nLd20VBPX22c28nRZKHlD/EV6tKvuqnqNsQdd2zY+72tLFfWj3uDC1NUbJmRK\nn38evrIPdJkBoUjgvdRWJ0uarJBZmySyaReyhLf4C+sgHtJR+Bm7QboSadaf\nCw1mi/Xpm6gRTo38Zdj/pzdf1Tc+UzC1jsIoy/To8qRsNoG3UUjfrP4d8RaI\nKmVdxLrQoZ6rjDohkfG0m3By7K/2uWvBrj97Eav7ddCtNbSL++xnKIbj9ZZh\nsMFrCxkKeud+A9iKnJgFrw3FKjoVsqsFPCCzTC6MVo7b/m1nn3MI6YNIl5/5\nCGuj/mLJ/ICSm+E8M9wvETRhnT4VJQ85U9a74K8hWNN0Y+JGJrmBalW0ZZDK\ntzwZ9oCCPyksgiq3Uzbcwg3XhhsPmT1zSyyUvd8guolyCgX6+tVGTTfQgn9i\nD4nGk+z3J0EB2Pulqn4lLVSEUeP9L5BNx36tgGPvrJUjuYXFKSg8M1tkDSby\nVi11JNVDmziL0rwTyLVKzVSEHoYNnQj0BkfQENoYiNa46NH99W1Hlr1aQDQQ\nPO5v\r\n=f1+o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICk1tNBT4e7qY0pOvlRcyUWz3wG0b8SjewWhLyALCmAdAiEA5fe30r7KzcPA3uG0FFkN/Vn5vFadSDMnMeJuTo/tGiQ="}],"size":2050,"noattachment":false,"key":"/cidr-regex/-/cidr-regex-3.0.0.tgz"},"maintainers":[{"email":"flipjs.io@gmail.com","name":"flipjsio"},{"email":"npm@silverwind.io","name":"silverwind"}],"_npmUser":{"name":"silverwind","email":"npm@silverwind.io"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cidr-regex_3.0.0_1589395108301_0.051172358464756984"},"_hasShrinkwrap":false,"readme":"# cidr-regex\n[![](https://img.shields.io/npm/v/cidr-regex.svg?style=flat)](https://www.npmjs.org/package/cidr-regex) [![](https://img.shields.io/npm/dm/cidr-regex.svg)](https://www.npmjs.org/package/cidr-regex) [![](https://packagephobia.com/badge?p=cidr-regex)](https://packagephobia.com/result?p=cidr-regex)\n\n> Regular expression for matching IP addresses in CIDR notation\n\n## Usage\n\n```sh\n$ npm i cidr-regex\n```\n\n```js\nimport cidrRegex from \"cidr-regex\";\n\n// Contains a CIDR IP address?\ncidrRegex().test(\"foo 192.168.0.1/24\");\n//=> true\n\n// Is a CIDR IP address?\ncidrRegex({exact: true}).test(\"foo 192.168.0.1/24\");\n//=> false\n\ncidrRegex.v6({exact: true}).test(\"1:2:3:4:5:6:7:8/64\");\n//=> true\n\n// Extract CIDRs from string\n\"foo 192.168.0.1/24 bar 1:2:3:4:5:6:7:8/64 baz\".match(cidrRegex());\n//=> [\"192.168.0.1/24\", \"1:2:3:4:5:6:7:8/64\"]\n```\n\n## API\n### cidrRegex([options])\n\nReturns a regex for matching both IPv4 and IPv6 CIDR IP addresses.\n\n### cidrRegex.v4([options])\n\nReturns a regex for matching IPv4 CIDR IP addresses.\n\n### cidrRegex.v6([options])\n\nReturns a regex for matching IPv6 CIDR IP addresses.\n\n#### options.exact\n\nType: `boolean`<br>\nDefault: `false` *(Matches any CIDR IP address in a string)*\n\nOnly match an exact string. Useful with `RegExp#test()` to check if a string is a CIDR IP address.\n\n## Related\n\n- [ip-bigint](https://github.com/silverwind/ip-bigint) - Convert IPv4 and IPv6 addresses to native BigInt and vice-versa\n- [ip-regex](https://github.com/sindresorhus/ip-regex) - Regular expression for matching IP addresses\n- [is-cidr](https://github.com/silverwind/is-cidr) - Check if a string is an IP address in CIDR notation\n- [is-ip](https://github.com/sindresorhus/is-ip) - Check if a string is an IP address\n- [cidr-tools](https://github.com/silverwind/cidr-tools) - Tools to work with IPv4 and IPv6 CIDR network lists\n\n## License\n\n© [silverwind](https://github.com/silverwind), distributed under BSD licence\n\nBased on previous work by [Felipe Apostol](https://github.com/flipjs)\n","publish_time":1589395108449,"_cnpm_publish_time":1589395108449,"dist-tags":{"latest":"7.1.2"}}