{"name":"cidr-regex","version":"2.0.9","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":">=4"},"files":["index.js"],"keywords":["cidr","regex","notation","cidr notation","prefix","prefixes","ip","ip address"],"dependencies":{"ip-regex":"^2.1.0"},"devDependencies":{"ava":"^0.25.0","eslint":"^4.19.1","eslint-config-silverwind":"^1.0.42","updates":"^3.0.0"},"gitHead":"5470d60688abc07ff46c8bce749ea4d99779d021","bugs":{"url":"https://github.com/silverwind/cidr-regex/issues"},"homepage":"https://github.com/silverwind/cidr-regex#readme","_id":"cidr-regex@2.0.9","_npmVersion":"6.1.0","_nodeVersion":"10.3.0","_npmUser":{"name":"silverwind","email":"npm@silverwind.io"},"dist":{"integrity":"sha512-F7/fBRUU45FnvSPjXdpIrc++WRSBdCiSTlyq4ZNhLKOlHFNWgtzZ0Fd+zrqI/J1j0wmlx/f5ZQDmD2GcbrNcmw==","shasum":"9c17bb2b18e15af07f7d0c3b994b961d687ed1c9","tarball":"http://registry-npm.ywwl.com/cidr-regex/download/cidr-regex-2.0.9.tgz","fileCount":4,"unpackedSize":4363,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbFa12CRA9TVsSAnZWagAA7rgP/iICEd5PsdUj+XJ2wt3G\n8qjw1HoulZcTAlIjMWkGyIxytu/jeTFXaSfM02QeFJO/cNA39V3EU71Q3OCB\nA0Q5Qu1r5ElF5VH8UmcnmrTMDILvUP1zCE6rNSJv3JvdyPCcyrBZ5g2B/S74\niZh12GDEDKYylAhweNiuelt2ibJIoh5Az3D/6MX8g4a3SLHpDKZqAlvyqwGx\nZe8M8gS2IMZkwhM3MYDq3O81/y0MlUJzWulzjC3QqW0pu22SaBzYW2puukwW\npe/ZyRvWg5qbIueF0uB5dv0W24S8K5V9QHTeTg/y1iKPcuv7tXsok2APO90X\n5B2s1TXSDDrzf03FhR9fZttRtOZwWPgMpC0h0daZ0sdaCoyGYORqnY4RDmG+\ntojnosKl7s/IPm+jaUfnSThgy6wljPHUOE4IwxSwLBuo4HCzyGgkW8Kbq5AI\n0vfc4RIbopC9SFoUqSj5/F0/9c5kRIC20n6PbLvEpptX5e2Dh3P4MJZeMzs9\n7aITAosJPfTVXpjkE2UzbRx85L9SV6nxs33f2Mjo1sQduFUzGszRe9ESQz2o\nRB9vGvC5fhLASgSm/hPDinzrR6ImfnmrlJkcv0uNjcyrKx94MeWlYqlJQPY/\nv6drEjbx+G2npEO1NXwyvsWZqXN2r9qylWS4sYCXxp9QHXuRTIJq0peIpdxn\n2mu4\r\n=+QDl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJFU9oJBb4kAHxGakgl5S+x8s3kWtsTI6b4Q+Iy+PXYAIgEIgede+Tt2ElWNCHkkzYQFj6MYeTrxAZyGc7QKItn4g="}],"size":2065,"noattachment":false,"key":"/cidr-regex/-/cidr-regex-2.0.9.tgz"},"maintainers":[{"email":"flipjs.io@gmail.com","name":"flipjsio"},{"email":"npm@silverwind.io","name":"silverwind"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cidr-regex_2.0.9_1528147318183_0.849414075645111"},"_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":1528147318285,"_cnpm_publish_time":1528147318285,"dist-tags":{"latest":"7.1.2"}}