I have a string like this:
NSString* msg = @"Hello this is a new message to @[123:Dr Zoidberg] and his nippers";
And I want to use -stringByReplacingMatchesInString:options:range:withTemplate:
to convert this pattern to:
NSString* msg = @"Hello this is a new message to Dr Zoidberg and his nippers";
This is what I have so far:
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"];
Can anyone help me with the @"????" pattern?