NSString *str = @"\hr发掘发掘法律是会计法kankfja";
NSRegularExpression *regularExpression = [NSRegularExpression regularExpressionWithPattern:@"(\h)r" options:0 error:nil];
NSString *content = [regularExpression stringByReplacingMatchesInString:str options:0 range:NSMakeRange(0,str.length) withTemplate:@"\n"];
NSLog(@"%@",content);
原文链接:https://www.f2er.com/regex/359577.html