I want to ensure that input fields doesn't contain backslash or Double Quotes characters
reportForm = this.fb.group({
summary: [null, [Validators.required, Validators.minLength(3), Validators.pattern()]],
],
By adding {3,}
instead of the +
you could also remove the minLength
Validator, since it is then included into the pattern.
var pattern = /^[^\\"]+$/;
console.log(pattern.exec('abc')); // 'abc' -> OK
console.log(pattern.exec('ab"c')); // null -> ERR
console.log(pattern.exec('\\abc')); // null -> ER