ip-regex

  • Version 5.0.0
  • Published
  • 7.67 kB
  • No dependencies
  • MIT license

Install

npm i ip-regex
yarn add ip-regex
pnpm add ip-regex

Overview

Regular expression for matching IP addresses (IPv4 & IPv6)

Index

Variables

variable ipRegex

const ipRegex: {
(options?: Options): RegExp;
v4(options?: Options): RegExp;
v6(options?: Options): RegExp;
};

    Interfaces

    interface Options

    interface Options {}

      property exact

      readonly exact?: boolean;
      • Only match an exact string. Useful with RegExp#test() to check if a string is an IP address. *(false matches any IP address in a string)*

        false

      property includeBoundaries

      readonly includeBoundaries?: boolean;
      • Include 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).

        false

      Package Files (1)

      Dependencies (0)

      No dependencies.

      Dev Dependencies (3)

      Peer Dependencies (0)

      No peer dependencies.

      Badge

      To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

      You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/ip-regex.

      • Markdown
        [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/ip-regex)
      • HTML
        <a href="https://www.jsdocs.io/package/ip-regex"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>