1
我使用下面的代碼來處理我的str
字符串:如何在正則表達式枚舉塊的末尾得到通知?
NSString *pattern = @"\\['(.*?)',(.*?),(.*?),(.*?),(.*?)\\]";
NSRegularExpression *regex = [NSRegularExpression
regularExpressionWithPattern:pattern
options:NSRegularExpressionCaseInsensitive
error:nil];
[regex enumerateMatchesInString:str
options:0
range:NSMakeRange(0, [str length])
usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop){
if (result != nil)
{
// do something with matched string
}
}];
我怎麼能知道當塊在其最後一次迭代這樣我就可以相應地同步我的程序?
謝謝。