Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想验证输入的文本是否是片假名。
我有这个:
Validators.pattern('[\u30A0-\u30FF]+')
但我也想接受两者之间的空格。我应该添加什么?
我解决了这个问题。我添加了\.<space>
\.<space>
Validators.pattern('[\u30A0-\u30FF\. ]+')
这在输入字段中接受片假名字符和空格