Iphone:NSPredicate 用于检查 id
我必须检查 ID 是否有效才能在系统中注册用户。为了做到这一点,我一直在阅读有关 NSPredicate 类的内容。
但是,我不知道如何构建下一个模式:
有效的 id 必须由 8 个数字和最后一个字母组成。有人能帮我吗?
谢谢
i have to check if an id is valid to register an user in the system. I have been reading about the class NSPredicate in order to do this.
However, i don't know how to build the next pattern:
A valid id has to be composed by 8 numbers and one final letter. Can anyone help me with that?
Thanks
试试这个(未经测试):
Try this out (untested):