我有一个这样的字符串:
NSString* msg = @"Hello this is a new message to @[123:Dr Zoidberg] and his nippers";
我想用来-stringByReplacingMatchesInString:options:range:withTemplate:
将此模式转换为:
NSString* msg = @"Hello this is a new message to Dr Zoidberg and his nippers";
这是我到目前为止所拥有的:
NSString* msg = @"Hello this is a new message to @[123:Dr Zoidberg] and his nippers";
NSRegularExpression* regex = [NSRegularExpression regularExpressionWithPattern: @"????"
options: NSRegularExpressionCaseInsensitive
error: nil];
NSString* plainText = [regex stringByReplacingMatchesInString: msg
options: 0
range: NSMakeRange(0, [msg length])
withTemplate: @"$2"];
任何人都可以帮助我@“??????” 图案?