- (NSMutableAttributedString *)modifyDigitalStr:(NSString*)str color:(UIColor *)color normalColor:(UIColor *)normalColor;
{
NSRegularExpression *regular = [NSRegularExpression regularExpressionWithPattern:@"([0-9]\\d*\\.?\\d*)" options:0 error:NULL];
NSArray<NSTextCheckingResult *> *ranges = [regular matchesInString:str options:0 range:NSMakeRange(0, [str length])];
NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc] initWithString:str attributes:@{NSForegroundColorAttributeName : normalColor}];
for (int i = 0; i < ranges.count; i++) {
[attStr setAttributes:@{NSForegroundColorAttributeName : color} range:ranges[i].range];
}
return attStr;
}
self.subtitleLab.attributedText = [self modifyDigitalStr:subtitle color:KColor16(@"fc7217") normalColor:kTextColor666666];