正则匹配术语
-(void)regularExpressionString:(NSString *)patternString andMatchString:(NSMutableAttributedString *)mactheStr withNo:(NSInteger)no
{
NSRegularExpression * re = [NSRegularExpression regularExpressionWithPattern:patternString options:NSRegularExpressionCaseInsensitive error:nil];
if (!re) {
}
NSArray * resultArray = [re matchesInString:mactheStr.string options:NSMatchingReportCompletion range:NSMakeRange(0, mactheStr.string.length)];
for (NSTextCheckingResult * match in resultArray)
{
NSRange range = [match range];
[mactheStr addAttribute:NSLinkAttributeName
value:[NSString stringWithFormat:@"%ldonmyView", no]
range:range];
}
}