{"name":"ip-regex","version":"5.0.0","description":"Regular expression for matching IP addresses (IPv4 & IPv6)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/ip-regex.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["ip","ipv6","ipv4","regex","regexp","re","match","test","find","text","pattern","internet","protocol","address","validate"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.19.1","xo":"^0.47.0"},"types":"./index.d.ts","gitHead":"a2a44dfa7f776528158c2a5ff9d8a1be435ec1b9","bugs":{"url":"https://github.com/sindresorhus/ip-regex/issues"},"homepage":"https://github.com/sindresorhus/ip-regex#readme","_id":"ip-regex@5.0.0","_nodeVersion":"14.17.5","_npmVersion":"8.1.0","dist":{"integrity":"sha512-fOCG6lhoKKakwv+C6KdsOnGvgXnmgfmp0myi3bcNwj3qfwPAxRKWEuFhvEFF7ceYIz6+1jRZ+yguLFAmUNPEfw==","shasum":"cd313b2ae9c80c07bd3851e12bf4fa4dc5480632","tarball":"http://registry-npm.ywwl.com/ip-regex/download/ip-regex-5.0.0.tgz","fileCount":5,"unpackedSize":7671,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh0IXECRA9TVsSAnZWagAAJKwP/1ByIst1nURyB81L9L93\nxFCx77Rs4eL/l66X3dc5yRlT5YtgHWf/m4hHdKX+FepXaHwk0fTMJTvl/zp1\nx4/j9ks0DB1y8vG3f/1KilttPv1knlcjQxf66Dfw0lZ8gxLHopUkdQzQZonW\nnjO8BZPh3X0YsIaFaQXXQCq3p6DDvmNAtt6EOO4rYRGWiktYxatjwbd471/X\n0qXw4MHK9STcsk4ukmm9Br8F3L8b/CIg+DEPX5mo4pDYhYDLOGFZm+ZpjnfU\nOkjEP7EvcUyZ0L2kxRQSZ4ZSo7hJ0EhBjFij0fMT17IvxM6/w/TwnArynSgp\niNm+oLMAsE4rYkFd/roAtVoo5zj6mJb+ZGy+CHOVA3LZ154llHIAaasxPgkF\natDvuoKzfI36p40xBOrOAstWLWqL6bunDEz0oFO+dbciXDfEdU7e2ZqsnUeN\n6lnM1Fd75Iksq0q7dhE6YhKzUMrvk/6I8w+U1J34oOS6w3RE3VszGQzpFRmR\nrcROj+qs2urmtjQgMjyhZg9UysXKtL7+kcZWvqYLU2ekjQL5PUnpg0CS7dOS\n8KcOZfKT8Hsf0hOS9pJA8MZ04QC4IM2WrpN6ZPIbJblzMztvSoVUR/BmDBlO\npIzR0vb9uM1btHewVfhmsMwjwznjn4dh/7RGifMyQeE/S72ote0xvLXRW+79\nJsp5\r\n=3Z4q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHz9kNowtrXFakqgujkQhmMZJQ3v6KL2fCEZTfbFsJjWAiEA9Bru/s6vCCrXJxS896a3b3tBjoA+9Y6zZDPthCP9f+s="}],"size":2769,"noattachment":false,"key":"/ip-regex/-/ip-regex-5.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ip-regex_5.0.0_1641055684348_0.17339799745863016"},"_hasShrinkwrap":false,"readme":"# ip-regex\n\n> Regular expression for matching IP addresses\n\n## Install\n\n```sh\n$ npm install ip-regex\n```\n\nThis module targets Node.js 12 or later and the latest version of Chrome, Firefox, and Safari. If you want support for older browsers, use version 2.1.0: `npm install ip-regex@2.1.0`\n\n## Usage\n\n```js\nimport ipRegex from 'ip-regex';\n\n// Contains an IP address?\nipRegex().test('unicorn 192.168.0.1');\n//=> true\n\n// Is an IP address?\nipRegex({exact: true}).test('unicorn 192.168.0.1');\n//=> false\n\nipRegex.v6({exact: true}).test('1:2:3:4:5:6:7:8');\n//=> true\n\n'unicorn 192.168.0.1 cake 1:2:3:4:5:6:7:8 rainbow'.match(ipRegex());\n//=> ['192.168.0.1', '1:2:3:4:5:6:7:8']\n\n// Contains an IP address?\nipRegex({includeBoundaries: true}).test('192.168.0.2000000000');\n//=> false\n\n// Matches an IP address?\n'192.168.0.2000000000'.match(ipRegex({includeBoundaries: true}));\n//=> null\n```\n\n## API\n\n### ipRegex(options?)\n\nReturns a regex for matching both IPv4 and IPv6.\n\n### ipRegex.v4(options?)\n\nReturns a regex for matching IPv4.\n\n### ipRegex.v6(options?)\n\nReturns a regex for matching IPv6.\n\n#### options\n\nType: `object`\n\n##### exact\n\nType: `boolean`\\\nDefault: `false` *(Matches any IP address in a string)*\n\nOnly match an exact string. Useful with `RegExp#test()` to check if a string is an IP address.\n\n##### includeBoundaries\n\nType: `boolean`\\\nDefault: `false`\n\nInclude boundaries in the regex. When `true`, `192.168.0.2000000000` will report as an invalid IPv4 address. If this option is not set, the mentioned IPv4 address would report as valid (ignoring the trailing zeros).\n\n## Related\n\n- [is-ip](https://github.com/sindresorhus/is-ip) - Check if a string is an IP address\n- [is-cidr](https://github.com/silverwind/is-cidr) - Check if a string is an IP address in CIDR notation\n- [cidr-regex](https://github.com/silverwind/cidr-regex) - Regular expression for matching IP addresses in CIDR notation\n","publish_time":1641055684482,"_cnpm_publish_time":1641055684482,"dist-tags":{"latest":"5.0.0"}}