5 lines
144 B
JavaScript
5 lines
144 B
JavaScript
|
export function isValidHostname(hostname) {
|
||
|
const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/;
|
||
|
return hostPattern.test(hostname);
|
||
|
}
|