Components/create-edit-modal: change url validation regex
This commit is contained in:
parent
a52a76b6d0
commit
1c9b1487de
1 changed files with 1 additions and 1 deletions
|
|
@ -63,7 +63,7 @@ export class CreateEditModalComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected addImageControl(value: string = "") {
|
protected addImageControl(value: string = "") {
|
||||||
const urlRegex: string = '(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?'
|
const urlRegex = "(https?:\\/\\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\\/\\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})"
|
||||||
this.images.push(new FormControl(value, [Validators.required, Validators.pattern(urlRegex)]))
|
this.images.push(new FormControl(value, [Validators.required, Validators.pattern(urlRegex)]))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue