{"_id":"ip-regex","_rev":"2111455","name":"ip-regex","description":"Regular expression for matching IP addresses (IPv4 & IPv6)","dist-tags":{"latest":"5.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2022-01-01T16:51:17.000Z","created":"2014-09-06T11:39:45.351Z","5.0.0":"2022-01-01T16:48:04.482Z","4.3.0":"2021-01-22T14:49:19.063Z","4.2.0":"2020-09-28T23:01:37.746Z","4.1.0":"2019-04-17T02:21:48.990Z","4.0.0":"2019-01-18T07:13:35.555Z","3.0.0":"2018-04-03T07:08:25.182Z","2.1.0":"2017-03-11T09:56:09.108Z","2.0.0":"2017-01-09T09:04:44.010Z","1.0.3":"2015-02-09T07:23:47.217Z","1.0.2":"2014-12-10T14:53:56.499Z","1.0.1":"2014-11-29T16:20:14.443Z","1.0.0":"2014-09-06T11:39:45.351Z"},"users":{"mojaray2k":true,"rocket0191":true,"xinwangwang":true,"librasean":true,"ganeshkbhat":true,"hualei":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/ip-regex.git"},"versions":{"5.0.0":{"name":"ip-regex","version":"5.0.0","description":"Regular expression for matching IP addresses (IPv4 & IPv6)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/ip-regex.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["ip","ipv6","ipv4","regex","regexp","re","match","test","find","text","pattern","internet","protocol","address","validate"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.19.1","xo":"^0.47.0"},"types":"./index.d.ts","gitHead":"a2a44dfa7f776528158c2a5ff9d8a1be435ec1b9","bugs":{"url":"https://github.com/sindresorhus/ip-regex/issues"},"homepage":"https://github.com/sindresorhus/ip-regex#readme","_id":"ip-regex@5.0.0","_nodeVersion":"14.17.5","_npmVersion":"8.1.0","dist":{"shasum":"cd313b2ae9c80c07bd3851e12bf4fa4dc5480632","size":2769,"noattachment":false,"key":"/ip-regex/-/ip-regex-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ip-regex/download/ip-regex-5.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ip-regex_5.0.0_1641055684348_0.17339799745863016"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-01-01T16:48:31.843Z","publish_time":1641055684482,"_cnpm_publish_time":1641055684482},"4.3.0":{"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":{"shasum":"687275ab0f57fa76978ff8f4dddc8a23d5990db5","size":2792,"noattachment":false,"key":"/ip-regex/-/ip-regex-4.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ip-regex/download/ip-regex-4.3.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ip-regex_4.3.0_1611326958896_0.2037906501761344"},"_hasShrinkwrap":false,"publish_time":1611326959063,"_cnpm_publish_time":1611326959063},"4.2.0":{"name":"ip-regex","version":"4.2.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":"eea8da6a69598e06908af3ecd9599a1734b20652","bugs":{"url":"https://github.com/sindresorhus/ip-regex/issues"},"homepage":"https://github.com/sindresorhus/ip-regex#readme","_id":"ip-regex@4.2.0","_nodeVersion":"14.11.0","_npmVersion":"6.14.8","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"a03f5eb661d9a154e3973a03de8b23dd0ad6892e","size":2850,"noattachment":false,"key":"/ip-regex/-/ip-regex-4.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ip-regex/download/ip-regex-4.2.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ip-regex_4.2.0_1601334097516_0.33303842781861515"},"_hasShrinkwrap":false,"publish_time":1601334097746,"_cnpm_publish_time":1601334097746},"4.1.0":{"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":{"shasum":"5ad62f685a14edb421abebc2fff8db94df67b455","size":2768,"noattachment":false,"key":"/ip-regex/-/ip-regex-4.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ip-regex/download/ip-regex-4.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ip-regex_4.1.0_1555467708812_0.31749112399295076"},"_hasShrinkwrap":false,"publish_time":1555467708990,"_cnpm_publish_time":1555467708990},"4.0.0":{"name":"ip-regex","version":"4.0.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"},"keywords":["ip","ipv6","ipv4","regex","regexp","re","match","test","find","text","pattern","internet","protocol","address","validate"],"devDependencies":{"ava":"^1.1.0","xo":"^0.24.0"},"gitHead":"45f4ab50a93cf129461c39494be2ed375ef9678e","bugs":{"url":"https://github.com/sindresorhus/ip-regex/issues"},"homepage":"https://github.com/sindresorhus/ip-regex#readme","_id":"ip-regex@4.0.0","_npmVersion":"6.5.0","_nodeVersion":"10.13.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"0120e0558a355604d511709c831a19adf8487b10","size":2485,"noattachment":false,"key":"/ip-regex/-/ip-regex-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ip-regex/download/ip-regex-4.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ip-regex_4.0.0_1547795615436_0.0800270746604328"},"_hasShrinkwrap":false,"publish_time":1547795615555,"_cnpm_publish_time":1547795615555},"3.0.0":{"name":"ip-regex","version":"3.0.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"},"files":["index.js"],"keywords":["ip","ipv6","ipv4","regex","regexp","re","match","test","find","text","pattern","internet","protocol","address","validate"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"605041b6a32ac7cca8b9c827bb9abc34e9336be0","bugs":{"url":"https://github.com/sindresorhus/ip-regex/issues"},"homepage":"https://github.com/sindresorhus/ip-regex#readme","_id":"ip-regex@3.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"0a934694b4066558c46294244a23cc33116bf732","size":2321,"noattachment":false,"key":"/ip-regex/-/ip-regex-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ip-regex/download/ip-regex-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ip-regex_3.0.0_1522739305091_0.2901866906975463"},"_hasShrinkwrap":false,"publish_time":1522739305182,"_cnpm_publish_time":1522739305182},"2.1.0":{"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","size":2157,"noattachment":false,"key":"/ip-regex/-/ip-regex-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ip-regex/download/ip-regex-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/ip-regex-2.1.0.tgz_1489226167327_0.37895454838871956"},"directories":{},"publish_time":1489226169108,"_cnpm_publish_time":1489226169108,"_hasShrinkwrap":false},"2.0.0":{"name":"ip-regex","version":"2.0.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":"425bb476fa3c1d73507047fda1586c719ae23641","bugs":{"url":"https://github.com/sindresorhus/ip-regex/issues"},"homepage":"https://github.com/sindresorhus/ip-regex#readme","_id":"ip-regex@2.0.0","_shasum":"913a92db023723d6d1a38b874c543893165b24ff","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.6.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"913a92db023723d6d1a38b874c543893165b24ff","size":2149,"noattachment":false,"key":"/ip-regex/-/ip-regex-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ip-regex/download/ip-regex-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/ip-regex-2.0.0.tgz_1483952683792_0.4461984606459737"},"directories":{},"publish_time":1483952684010,"_cnpm_publish_time":1483952684010,"_hasShrinkwrap":false},"1.0.3":{"name":"ip-regex","version":"1.0.3","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":"4237cf39da0e1b2ea883bc65bde2b69921d78ceb","bugs":{"url":"https://github.com/sindresorhus/ip-regex/issues"},"homepage":"https://github.com/sindresorhus/ip-regex","_id":"ip-regex@1.0.3","_shasum":"dc589076f659f419c222039a33316f1c7387effd","_from":".","_npmVersion":"2.5.0","_nodeVersion":"0.12.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"dc589076f659f419c222039a33316f1c7387effd","size":1847,"noattachment":false,"key":"/ip-regex/-/ip-regex-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/ip-regex/download/ip-regex-1.0.3.tgz"},"directories":{},"publish_time":1423466627217,"_cnpm_publish_time":1423466627217,"_hasShrinkwrap":false},"1.0.2":{"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":""}],"dist":{"shasum":"1e7daad2c2d0c268729ecca91f8ec463ad58f56b","size":1155,"noattachment":false,"key":"/ip-regex/-/ip-regex-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/ip-regex/download/ip-regex-1.0.2.tgz"},"directories":{},"publish_time":1418223236499,"_cnpm_publish_time":1418223236499,"_hasShrinkwrap":false},"1.0.1":{"name":"ip-regex","version":"1.0.1","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":"1844317d3c1adaa8848e893269fc599a54b0057e","bugs":{"url":"https://github.com/sindresorhus/ip-regex/issues"},"homepage":"https://github.com/sindresorhus/ip-regex","_id":"ip-regex@1.0.1","_shasum":"3f1da464e47290591023a70617e45361b41123f7","_from":".","_npmVersion":"2.1.5","_nodeVersion":"0.10.32","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"3f1da464e47290591023a70617e45361b41123f7","size":1162,"noattachment":false,"key":"/ip-regex/-/ip-regex-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/ip-regex/download/ip-regex-1.0.1.tgz"},"directories":{},"publish_time":1417278014443,"_cnpm_publish_time":1417278014443,"_hasShrinkwrap":false},"1.0.0":{"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":""}],"dist":{"shasum":"ea90b7e1951898d36eecd24f2ab6942347b4ab28","size":1160,"noattachment":false,"key":"/ip-regex/-/ip-regex-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ip-regex/download/ip-regex-1.0.0.tgz"},"directories":{},"publish_time":1410003585351,"_cnpm_publish_time":1410003585351,"_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","_attachments":{},"homepage":"https://github.com/sindresorhus/ip-regex#readme","bugs":{"url":"https://github.com/sindresorhus/ip-regex/issues"},"license":"MIT"}