core.isvalidhostname | Medplum

isValidHostname() function

Tests whether a given input is a valid hostname.

NOTE: Does not validate that the input is a valid domain name, only a valid hostname.

Signature:

export declare function isValidHostname(input: string): boolean;

Parameters [​](/content/docs/sdk/core.isvalidhostname#parameters "Direct link to Parameters"/index.html)

Parameter Type Description
input string The input to test.

Returns:

boolean

True if input is a valid hostname, otherwise returns false.

Valid matches:

Invalid matches: