diff options
Diffstat (limited to 'client/src/app/shared/forms/form-validators/host.validator.ts')
-rw-r--r-- | client/src/app/shared/forms/form-validators/host.validator.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/client/src/app/shared/forms/form-validators/host.validator.ts b/client/src/app/shared/forms/form-validators/host.validator.ts index ec417e079..03e810fdb 100644 --- a/client/src/app/shared/forms/form-validators/host.validator.ts +++ b/client/src/app/shared/forms/form-validators/host.validator.ts | |||
@@ -1,14 +1,14 @@ | |||
1 | import { FormControl } from '@angular/forms'; | 1 | import { FormControl } from '@angular/forms' |
2 | 2 | ||
3 | export function validateHost(c: FormControl) { | 3 | export function validateHost (c: FormControl) { |
4 | // Thanks to http://stackoverflow.com/a/106223 | 4 | // Thanks to http://stackoverflow.com/a/106223 |
5 | const HOST_REGEXP = new RegExp( | 5 | const HOST_REGEXP = new RegExp( |
6 | '^(([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])$' | 6 | '^(([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])$' |
7 | ); | 7 | ) |
8 | 8 | ||
9 | return HOST_REGEXP.test(c.value) ? null : { | 9 | return HOST_REGEXP.test(c.value) ? null : { |
10 | validateHost: { | 10 | validateHost: { |
11 | valid: false | 11 | valid: false |
12 | } | 12 | } |
13 | }; | 13 | } |
14 | } | 14 | } |