我有NSString
几个这样的字符串,465544664646
它们之间是变化的:
data-context-item-title="465544664646"
465544664646
我如何将字符串解析为数组?
编辑
NSRegularExpression* myRegex = [[NSRegularExpression alloc] initWithPattern:@"(?i)(data-context-item-title=\")(.+?)(\")" options:0 error:nil];
[myRegex enumerateMatchesInString:responseString options:0 range:NSMakeRange(0, [responseString length]) usingBlock:^(NSTextCheckingResult *match, NSMatchingFlags flags, BOOL *stop) {
NSRange range = [match rangeAtIndex:1];
NSString *string =[responseString substringWithRange:range];
NSLog(string);
}];