iOS 正则

正则表达式 得讲解

http://www.jb51.net/tools/zhengze.html#mission

    NSError* error = NULL;
//parten是正则表达式
    NSRegularExpression *reg = [NSRegularExpression regularExpressionWithPattern:parten options:NSRegularExpressionCaseInsensitive error:&error];
//bankinfoString是整个字符
    NSArray *match = [reg matchesInString:bankinfoString options:NSMatchingReportCompletion range:NSMakeRange(0, bankinfoString.length)];
    
    for (NSTextCheckingResult *result in match) {
        NSRange range = result.range;
        if (range.location != NSNotFound) {
        
        }
    } 


你可能感兴趣的:(iOS)