我希望在2009-2059年期间在typeScript代码中验证验证器模式中的数字。我试过很多种方法,但却找不到办法去做?请您看一下示例代码并告诉我如何修复它好吗?
问候阿尔珀
您可以看到下面的示例代码。
],'Input3': [this.guiTranformatorInput.JJJJ_input3,[
Validators.required,
Validators.pattern('20[0-5][8-9]'),
]发布于 2017-04-20 09:12:53
你的范围模式错了,试试这个
20((09)|([1-5][0-9]))
20: start with 20
(
09: literal 09
or
1-5 and 0-9
)或者使用自定义验证器:https://stackoverflow.com/a/39848327/3676586
https://stackoverflow.com/questions/43514401
复制相似问题