I want to do pretty much the same as in Excluding strings using regex but I want to do it iOS using Regex. So I basically I want to find matches in a string and then remove them from the string so if I have a string like this, Hello #world @something I want to find #world & @something and then remove them from the string so it just becomes Hello. I already have this expression that removes #world and something but not the @, #[\\p{Letter}]+|[^@]+$ I solved the @ problem by doing this
NSString *stringWithoutAt = [input stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"@%@",atString] withString:@""];
NSString *stringWithoutTag = [input stringByReplacingOccurrencesOfString:tagString withString:@""];
So for the first one I end up with Hello #world and the second one Hello @something. But is there a way of using Regex or something else to remove both the #world and the @something at the same time?