正则表达式:
static inline NSRegularExpression * AuthorRegularExpression() {
if (!__authorRegularExpression) {
__authorRegularExpression = [[NSRegularExpression alloc] initWithPattern:@"-\\s*(.)*$" options:NSRegularExpressionCaseInsensitive error:nil];
}
return __authorRegularExpression;
}
用来检测破折号(-),但是现在我将破折号格式改为em-dash。然后字符串就变成:
NSString *dashAuthor = [NSString stringWithFormat:@"%C %@", 0x2014, self.theme.quoteAuthor];
应该怎么修改正则表达式来映射这个?这样可以搜索到作者名后面带有em-dash的。