匹配由数字和26个英文字母组成的字符串

 用到了一个第三方RegexKitLite

 #import "RegexKitLite.h"

 进行匹配

    NSString *regex = @"^[A-Za-z0-9]+$"; // 匹配由数字和26个英文字母组成的字符串

    if (![self.textField.text stringByMatching:regex]) {

        [toolset MBProgressHUDWithText:@"请输入纯字母和数字"];

        return;

    }
原文地址:https://www.cnblogs.com/Milo-CTO/p/5803887.html