aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/forms/form-validators
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/forms/form-validators')
-rw-r--r--client/src/app/shared/forms/form-validators/host.validator.ts5
1 files changed, 4 insertions, 1 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 9cb46d361..ea3e43cb1 100644
--- a/client/src/app/shared/forms/form-validators/host.validator.ts
+++ b/client/src/app/shared/forms/form-validators/host.validator.ts
@@ -1,7 +1,10 @@
1import { FormControl } from '@angular/forms'; 1import { FormControl } from '@angular/forms';
2 2
3export function validateHost(c: FormControl) { 3export function validateHost(c: FormControl) {
4 let HOST_REGEXP = new RegExp('^(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$'); 4 // Thanks to http://stackoverflow.com/a/106223
5 let 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])$'
7 );
5 8
6 return HOST_REGEXP.test(c.value) ? null : { 9 return HOST_REGEXP.test(c.value) ? null : {
7 validateHost: { 10 validateHost: {