[英]String Pattern Validation in Typescript
In Typescript, how to validate string pattern?在 Typescript 中,如何验证字符串模式? example const str = "ABC1-AB9"
例如 const str = "ABC1-AB9"
^[A-z0-9]{4}-[A-z0-9]{3} [0-9]{1}
This could be the regex you are looking for.这可能是您正在寻找的正则表达式。 You can test the same by going to https://regexr.com/ website and making your own custom regex.
您可以通过访问https://regexr.com/网站并制作自己的自定义正则表达式来进行测试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.