is_ipv6: Check if an argument is an IPv6 address string

View source: R/string.R

is_ipv6R Documentation

Check if an argument is an IPv6 address string

Description

Validates full, compressed (::) and IPv4-embedded (⁠::ffff:192.168.1.1⁠) forms. Zone IDs (e.g. ⁠%eth0⁠) are not supported.

Usage

is_ipv6(x)

Arguments

x

(any)
Object to check.

Value

TRUE if x is a valid IPv6 address string, FALSE otherwise.

Examples

is_ipv6("2001:0db8:85a3:0000:0000:8a2e:0370:7334")
is_ipv6("::1")

checkstring documentation built on Sept. 28, 2026, 5:07 p.m.