草庐IT

NSRegularExpressions

全部标签

Objective-C NSRegularExpressions,查找字符串中数字的第一次出现

我对Objective-C的正则表达式还很陌生。我遇到了一些困难。NSRegularExpression*regex=[NSRegularExpressionregularExpressionWithPattern:@"\\b([1-9]+)\\b"options:NSRegularExpressionCaseInsensitiveerror:®Error];if(regError){NSLog(@"%@",regError.localizedDescription);}__blockNSString*foundModel=nil;[regexenumerateMatchesIn