{"name":"ip-regex","version":"4.3.0","description":"Regular expression for matching IP addresses (IPv4 & IPv6)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/ip-regex.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["ip","ipv6","ipv4","regex","regexp","re","match","test","find","text","pattern","internet","protocol","address","validate"],"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"726885d9b6a2f9b77d0a00e56843ece0f79b2da5","bugs":{"url":"https://github.com/sindresorhus/ip-regex/issues"},"homepage":"https://github.com/sindresorhus/ip-regex#readme","_id":"ip-regex@4.3.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==","shasum":"687275ab0f57fa76978ff8f4dddc8a23d5990db5","tarball":"http://registry-npm.ywwl.com/ip-regex/download/ip-regex-4.3.0.tgz","fileCount":5,"unpackedSize":7501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCuXvCRA9TVsSAnZWagAAaskP/A7QSNZA1jKdq7PF0dug\nSStCypbik2Y0hQCD7oeu4qrIxbuTTwmeHjnxDp4AuRhASoGBpiLqNaQKUGoo\nw67NFWr1+qB7uK3QpcH18Pq93sXVd1TR4mGh3gLqXE38T3QsHp2Tta0M8zU4\nCnTF3JhkkpDk6gq49j4U3kBffummxwQZpJGoFQ3/Z/DDGQ/uBkt5B+RjIWxz\nXhR8wL+hYgmw932EdXfc6SvvtXQOCuiWzhXYec8mftX4EulCx2MFe/FQsIi8\n+O6FHJixbmlMw088qItkFpzagK9Opz5naaEiEGxnGUzDtodruEiHq33HAx+S\nYmasqCKQihnnJ3u1V1b0CH6iAgrQXBqWhJxG4qzIlW4lw8FWvYWZeuYZ8C2C\nGuH5smmGTqutTf/pa9p1SRrLJPxC+c9Z8i5noM0wDwmUA2QQVjS8xj0jUMZ3\napmZAnERIIZURRooeHCwjOqTE5KQH8JYUry/D8fR8jDLBU5mPnHAHTHfgI+k\nmWNJbsxkNk4IQrJ+3LYn879K+QlYFKlFx/y/KGoZY2cwPntwbmH0TeXq/kcr\ntjszXWLMiaSVLC1xPRStbpTsNYEhLnLhWSj7TQXOJ0NaZNQhliEGRQmCzSkJ\nqADdEBZiz/DTH37sKAU2loU9p3LGxsj1K/8HzG4CkSkyqQgy1TSyCm+DASle\nMxV1\r\n=gOeD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFltZp+O+aiM9Z7nM6aF//ivM8Ors6AqsdTKBjalg7h4AiAQP3qtIlQSXmF73Uwnjf6S5eMTwZbrl3YSsYabeutA3g=="}],"size":2792,"noattachment":false,"key":"/ip-regex/-/ip-regex-4.3.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ip-regex_4.3.0_1611326958896_0.2037906501761344"},"_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":1611326959063,"_cnpm_publish_time":1611326959063,"dist-tags":{"latest":"5.0.0"}}