{"name":"ip-regex","version":"2.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":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["ip","ipv6","ipv4","regex","regexp","re","match","test","find","text","pattern","internet","protocol","address","validate"],"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"3f6478e54773d2ad79de39da4f4e1b9df34fa9a7","bugs":{"url":"https://github.com/sindresorhus/ip-regex/issues"},"homepage":"https://github.com/sindresorhus/ip-regex#readme","_id":"ip-regex@2.1.0","_shasum":"fa78bf5d2e6913c911ce9f819ee5146bb6d844e9","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.5.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"fa78bf5d2e6913c911ce9f819ee5146bb6d844e9","tarball":"http://registry-npm.ywwl.com/ip-regex/download/ip-regex-2.1.0.tgz","integrity":"sha512-58yWmlHpp7VYfcdTwMTvwMmqx/Elfxjd9RXTDyMsbL7lLWmhMylLEqiYVLKuLzOZqVgiWXD9MfR62Vv89VRxkw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC8BstABeYuNz3Ye+kPiJkvcW45A0TevzC/SN/obxxyLAiA1JtD8U3aXiRFlxWV/xNU0kRz4OkM0oH6E1ddtJab/Bg=="}],"size":2157,"noattachment":false,"key":"/ip-regex/-/ip-regex-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/ip-regex-2.1.0.tgz_1489226167327_0.37895454838871956"},"directories":{},"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":1489226169108,"_cnpm_publish_time":1489226169108,"dist-tags":{"latest":"5.0.0"}}