{"name":"ip-regex","version":"4.1.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":"ebdcc9c7b4136ba3c7503730e4bf92ba855f136f","bugs":{"url":"https://github.com/sindresorhus/ip-regex/issues"},"homepage":"https://github.com/sindresorhus/ip-regex#readme","_id":"ip-regex@4.1.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-pKnZpbgCTfH/1NLIlOduP/V+WRXzC2MOz3Qo8xmxk8C5GudJLgK5QyLVXOSWy3ParAH7Eemurl3xjv/WXYFvMA==","shasum":"5ad62f685a14edb421abebc2fff8db94df67b455","tarball":"http://registry-npm.ywwl.com/ip-regex/download/ip-regex-4.1.0.tgz","fileCount":5,"unpackedSize":7422,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcto29CRA9TVsSAnZWagAAzAIQAIm7avORuFoVw3Vg1jSm\ncpMu7L3IsQSBeaqPv0y0vzcCqIKkN9PPkcXuN1ch72Skb9t2KocY7wObedh4\nHmhK64dPDG1l5vkS5InOnbL9s6Ih1aBHeXHmyvtz74v2x+A87iNEGhRjnckw\nFdZ8n9OFOGH5vxdBwqnr5EjLvMZ3jLjtnm/cNO9pFMmVxfXViRvTIinfQcMc\nH4vya3ULzWrgUrmFC1sn3ZLJy6qqDRAb0SjOjk8nnIZlZUWjsmlxw2mivFJy\nx6+QnXZSQxrma3XviJTw+s7RK5INJW5S7S0kDENnlH4O5GYYGEHWyvDKfLy3\nig0atQ7AQP0l6xJXAsR0nj1g8BuGIrucZIVWYNznJ6qhdPsUqUfalOOwlUjj\ng0QQ8RO8mHVn1ricOnmkrl5Xu+s1uwrDdD0YxwnOdXZdzWIRGmrDKEcQNaZn\nZ8vbrIY5Mx9MMwAPhUc5KnLG7WMwJMyl+bLJSwVXoXWwfnUl1WfoCd+uh6k8\nIcrvMcblvvi774fx1NL81UpL47kjC8Lw1q1QZI9r+hMv+an8RdM0VzEEk/Fq\nRxinlGGMyFJ3oee8AzKw84gmLbMwlbz0f2hhbP4GXHfadsgoQ5EmVTXVxQuS\n9D/fArrtu6E4EnAwIAjT1dbbPUxMsVYj6J6eisSD2qiZKD9hHSEodPUHPOkk\neiKi\r\n=O9jy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHWshI/iWbXexyzCSPmwX5ih2y82z6evnefx5/IW7mR0AiAq0jVG6Lc6QRMeySvitvM7Oe+ygekgTCcL6WL2mmt9Pg=="}],"size":2768,"noattachment":false,"key":"/ip-regex/-/ip-regex-4.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ip-regex_4.1.0_1555467708812_0.31749112399295076"},"_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":1555467708990,"_cnpm_publish_time":1555467708990,"dist-tags":{"latest":"5.0.0"}}