{"name":"ip-regex","version":"1.0.0","description":"Regular expression for matching IP addresses","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/ip-regex"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js"},"files":["index.js"],"keywords":["text","regex","regexp","re","match","test","find","pattern","ip","internet","protocol","address","validate"],"devDependencies":{"ava":"0.0.4"},"bugs":{"url":"https://github.com/sindresorhus/ip-regex/issues"},"homepage":"https://github.com/sindresorhus/ip-regex","_id":"ip-regex@1.0.0","_shasum":"ea90b7e1951898d36eecd24f2ab6942347b4ab28","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"dist":{"shasum":"ea90b7e1951898d36eecd24f2ab6942347b4ab28","tarball":"http://registry-npm.ywwl.com/ip-regex/download/ip-regex-1.0.0.tgz","integrity":"sha512-MQIVkis6gn6alcooswfUoi2CSQMk8OfyWN7hg+59lmgyUj3LqnUZsnc2xPndf31wHdoGoxSbuBZt7M/vXAT4lg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA0uzzK99NeedXxeVPlYeAW/gW4l+JRECwHjiJQRdN9fAiEAsW7IW6PaWhHXH8yuZZ2R4LqTAK7C4SQB5vcoBzJZorc="}],"size":1160,"noattachment":false,"key":"/ip-regex/-/ip-regex-1.0.0.tgz"},"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":1410003585351,"_cnpm_publish_time":1410003585351,"dist-tags":{"latest":"5.0.0"}}