sindresorhus

ip-regex

Regular expression for matching IP addresses

by sindresorhus

JavaScript

JavaScript96.2%
TypeScript3.8%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template
silverwind

Some tools like accept zero-padded IPv4s as valid. I think this module might consider accepting them too, even thought node's also considers them invalid: Some more opinions about it here.

silverwind · 2y ago
Mastercuber

Hi, this PR introduces a new option called . With this option, it is possible to check if a IPv4 address is in the private address range. For some applications - like starting a dev server only with a private IP address - it seems to be handy, to be able to check if an IP address is private or public. Some tests are included. This PR also extracts the IP octet as a constant, for making the regex's more readable.

Mastercuber · 2y ago
Structured data for AI agents

Repository: sindresorhus/ip-regex. Description: Regular expression for matching IP addresses Stars: 197, Forks: 31. Primary language: JavaScript. Languages: JavaScript (96.2%), TypeScript (3.8%). License: MIT. Latest release: v5.0.0 (4y ago). Open PRs: 0, open issues: 0. Last activity: 2mo ago. Community health: 85%. Top contributors: sindresorhus, Mottie, silverwind, coreyfarrell, Piterden, BendingBender, RichardLitt, Richienb, roryrjb.