I found a regex pattern on this website that I want to use in my Angular app.
To implement it, I copied the regex and enclosed it with two / characters...
websiteRegex = /?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'^(?:http(s)\(\)\*\+,;=.]+$/;
website: ['', [Validators.maxLength(250), Validators.pattern(this.websiteRegex)]]
This results in a compile error:
Module parse failed: Invalid regular expression: /?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'^(?:http(s)\(\)\*\+,;=.]+$/: Nothing to repeat
How should I go about resolving this issue?