I have a textarea with a simple FormControl, which I'd like to validate via the Validators.pattern() method. None of the new lines should be started with a ? or *. That's all the requirements.
I've tried the following:
control = new FormControl('', Validators.pattern(/^(\?|\*)$/));
With this, I can validate the first line (works well if the line starts with a special character), but as soon as I hit enter my FormControl will be invalid.
How should I tweak the regex to meet the requirements?