Angular自定义validators
private validatePatternNot(pattern: string | RegExp) { const reg = new RegExp(pattern); return (control: AbstractControl) => { let value = control.value; if (!value && value !== 0) return null; value = value + ''; if (!reg.test(value)) return null; return { notPattern: true }; } }