ip-regex
Regular expression for matching IP addresses
Install
Usage
API
ipRegex([options])
Returns a regex for matching both IPv4 and IPv6.
ipRegex.v4([options])
Returns a regex for matching IPv4.
ipRegex.v6([options])
Returns a regex for matching IPv6.
options.exact
Type: boolean
Default: false
(Matches any IP address in a string)
Only match an exact string. Useful with RegExp#test()
to check if a string is an IP address.
Related
is-ip - Check if a string is an IP address
License
MIT © Sindre Sorhus
Last updated