{"name":"cidr-regex","version":"3.1.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.8.1","eslint-config-silverwind":"18.0.8","jest":"26.4.2","tsd":"0.13.1","updates":"10.3.6","versions":"8.4.3"},"gitHead":"938c09abdfa838a438cb19aaf21de50f6b0b4c0b","bugs":{"url":"https://github.com/silverwind/cidr-regex/issues"},"homepage":"https://github.com/silverwind/cidr-regex#readme","_id":"cidr-regex@3.1.0","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-1RUJy3vvQijcK9I4mDbJEMUROwGw5Vu7qmF6MIM6k08kKQzHhhEr1QnOY/t80lp/hWawxu08xzNfvH9w0dFhmA==","shasum":"83189b2996a115cf20823f0697334117e3636122","tarball":"http://registry-npm.ywwl.com/cidr-regex/download/cidr-regex-3.1.0.tgz","fileCount":5,"unpackedSize":5526,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfV7LzCRA9TVsSAnZWagAACEEP/2DK6zpVlLzLCLoWVnDg\nM8OWL5opTOHalCQxebh3yMljwvltaCVNYeo2KkFd1GkVjnhZHuUonxdR8b2E\n8WshLTfVF1bH6Ajsdd1MRjwNdZDwyPlRefZRTpZ1lB3Je+x33EhzZNdFOEw0\nRvfXEZMkAdJ1QdiKiipF2w74C1q8B4iMa4ysHDh2GqF5x4tPo3dxAV2lnmPI\nvLR+tSL5wkjikPJ9qK3iY48Jpi4CQrFuEd3TI0kegjeGW6lldQRYPiE3AKCp\nLsQAabx0L+BPN+/E6EyWh/l7DAaZ80T3etdQ0cp1bTwrFtDSgzFYGZ68/e2r\nynOmWXWwmHJsgg0C2nDFgQqW5a/IzLX07nCorh1g/d2JpaikF6XdoH7EvB+t\nxR3uYY/3DcJTMDzDqg9Z406ryXZAnZQ/2zIiBFhO5/M+WSrobw7svCFFUBx3\nycSTkStnbiE5SZO6cHthBpBwtMEnz0gJqeVew5Mozlm9LQb2BFI2fFEbKnzv\nWIWJ43J2s0z+I+QkWcXWhrTPrxOnKFk3p7gkzKIxoHYeEZGMt2FSpMaSK5TF\n5PHEBGv+U1+mulGN2inGx7dD4TYxE8wH0Z4CfQK075Vzvtpgz9FwwTTVjLdF\nOy807HHeh0U56h7Po9NRzpms84KTiE5dFt6rNJz+zLB0hJAYEATPOsdla6gm\n6g/I\r\n=IrUx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBh07nFYJYjK8FWhaoaFNZLnpkw9qFk8gbUtR+DRuW6QIhAIrGra9ycQJY8vlXcI8sRhIuIeHFVWmTrWfChtIhw8uK"}],"size":2312,"noattachment":false,"key":"/cidr-regex/-/cidr-regex-3.1.0.tgz"},"maintainers":[{"name":"flipjsio","email":"flipjs.io@gmail.com"},{"name":"silverwind","email":"npm@silverwind.io"}],"_npmUser":{"name":"silverwind","email":"npm@silverwind.io"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cidr-regex_3.1.0_1599582962934_0.9220640933392685"},"_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":1599582963047,"_cnpm_publish_time":1599582963047,"dist-tags":{"latest":"7.1.2"}}