I hope the form input value not contains any backspace or linefeed char, so I use the Validators.pattern to do, but failed, how this reg should be?
Validators.pattern(/(?![\b|\n])/)
The (?![\b|\n]) pattern presents a negative lookahead that matches a location that is not followed with a backspace, | or a newline. It does not guarantee that the whole string does not match this pattern.
You are looking for
Validators.pattern(/^[^\b\n]+$/)
Or
Validators.pattern("[^\b\n]+")
Note that string patterns are wrapped in ^...$ (="anchored") automatically.
Pattern details
^ - start of string[^ - start of a negated character class
\b - a backspace (inside a character class, it is always parsed as a backspace)\n - an LF symbol]+ - end of the character class, repeat 1+ times$ - end of string.Try putting the argument in quotes : Validators.pattern('/(?![\b|\n])/')