Kernel 8.0 APIs Banner
Office of Information and Technology (OIT) Banner
[skip navigation]

$$VALIDATE^XLFIPV(): Validate IP Address Format

Reference Type: Supported, Category: IP Address Functions, ICR#: 5844

Description

The $$VALIDATE^XLFIPV extrinsic function validates the format of an Internet Protocol (IP) address (either IPv4 or IPv6).

Format

  $$VALIDATE^XLFIPV(ip)

Input Parameters

ip:

(required) IPv4 or IPv6 address (string; in quotes) to be validated.

Output

returns:

Returns:

  • 1—If the IP address is in a valid format.

  • 0—If the format is invalid or NULL input.

Examples

Example 1

>S X=$$VALIDATE^XLFIPV("10.126.3.1")

>W X
1

Example 2

>S X=$$VALIDATE^XLFIPV("10.999.3.1")

>W X
0

Example 3

>S X=$$VALIDATE^XLFIPV("2001:db8::8a2e:370:7334")

>W X
1

Example 4

>S X=$$VALIDATE^XLFIPV("2001:db8::8g2h:370:7334")

>W X
0