I use the following regex:
/https{1}:\/\/(?:\$INSTANCE\$)(?:\/\w+){0,255}(?:\?\w+=\w+){0,1}(?:\&\w+=\w+){0,255}/ysg
and the following url-like structure for a match:
https://$INSTANCE$/eng/route?param=val¶meter3=value&prmtr=value
event though the regex is valid, Angular keeps giving this error:
SyntaxError: nothing to repeat
I validated the regex using this site: https://regex101.com/r/6x4kP2/1
Anyone know what is wrong with the regex?
The code where I use it:
patternCustomTSConfigURL = "https{1}:\/\/(?:\$INSTANCE\$)(?:\/\w+){0,255}(?:\?\w+=\w+){0,1}(?:\&\w+=\w+){0,255}",
this.exampleForm = new FormGroup({
url: new FormControl(this.url, [
Validators.required,
Validators.minLength(5),
Validators.maxLength(255),
Validators.pattern(patternCustomTSConfigURL)
])
});