Skip to content

@technobuddha > library > RegExp > Validation

Function: isIPV4Local()

ts
function isIPV4Local(address: string): boolean;

Defined in: is-ipv4-local.ts:17

Determines whether the given IPv4 address is a local (private) address.

Parameters

ParameterTypeDescription
addressstringThe IPv4 address to check.

Returns

boolean

true if the address is a local IPv4 address, otherwise false.

Example

typescript
isIPV4Local('192.168.1.1'); // true
isIPV4Local('8.8.8.8');     // false