【发布时间】:2014-01-05 13:58:40
【问题描述】:
我正在构建一个用于 iOS 应用程序解析器的正则表达式。这是我的代码:
NSRegularExpression *regex =
[NSRegularExpression regularExpressionWithPattern:@"(?<=#EXT[^\r\n]*[\r\n]+)[^#][^\r\n]+"
options:NSRegularExpressionAnchorsMatchLines
error:®exError
];
if (regexError) {
NSLog(@"regexError: %@", regexError);
return nil;
}
来自this answer。
这给出了这个错误:
regexError: Error Domain=NSCocoaErrorDomain Code=2048 "The operation couldn’t be completed. (Cocoa error 2048.)" UserInfo=0x8e86670 {NSInvalidValue=(?<=#EXT[^
Cocoa 错误 2048 是 NSFormattingErrorMinimum according to the docs... 但实际上没有进一步的解释。
这是什么意思?
【问题讨论】:
标签: ios regex cocoa nsregularexpression