{"name":"ip-regex","version":"1.0.2","description":"Regular expression for matching IP addresses","license":"MIT","repository":{"type":"git","url":"https://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"},"gitHead":"077df3268bbad242f5b7de42b97e6d8b6165bb76","bugs":{"url":"https://github.com/sindresorhus/ip-regex/issues"},"homepage":"https://github.com/sindresorhus/ip-regex","_id":"ip-regex@1.0.2","_shasum":"1e7daad2c2d0c268729ecca91f8ec463ad58f56b","_from":".","_npmVersion":"2.1.5","_nodeVersion":"0.10.32","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"dist":{"shasum":"1e7daad2c2d0c268729ecca91f8ec463ad58f56b","tarball":"http://registry-npm.ywwl.com/ip-regex/download/ip-regex-1.0.2.tgz","integrity":"sha512-i9euNp9QUyZ3PXO/WqY6j6pffF2sko9vJKT9NxanqgKMqJFZ0HlEuLU6aj+u+pfdvNchjqDVbCaV8GuEdI3rqQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDhLBB3wLozGHGx1HKAaS/ml7DBbGFT8XCm95EDIdSYDAiBS8VyMFQucx8EsCPov7nDKq10mm/h+Z4Cy3hIJ64yHuA=="}],"size":1155,"noattachment":false,"key":"/ip-regex/-/ip-regex-1.0.2.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":1418223236499,"_cnpm_publish_time":1418223236499,"dist-tags":{"latest":"5.0.0"}}