【发布时间】:2011-09-29 06:26:55
【问题描述】:
我有一个字符串,例如@"You've earned Commentator and 4 ##other$$ badges"。我想检索由## 和$$ 分隔的子字符串@"other"。我做了一个这样的 NSRegularExpression:
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"##(.*)$$" options:NSRegularExpressionCaseInsensitive error:nil];
这完全忽略了$$ 并返回以## 开头的内容。我究竟做错了什么?谢谢。
【问题讨论】:
标签: objective-c ios regex cocoa-touch nsregularexpression