]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/shared/shared-forms/form-validators/host.ts
Update build steps for localization
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-forms / form-validators / host.ts
CommitLineData
e600e1fe 1export function validateHost (value: string) {
447fde27 2 // Thanks to http://stackoverflow.com/a/106223
ad4a8a1c 3 const HOST_REGEXP = new RegExp(
447fde27 4 '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$'
df98563e 5 )
49abbbbe 6
e600e1fe 7 return HOST_REGEXP.test(value)
49abbbbe 8}