I want to replace all the string except the @[anyword]
I have string like this:
yng nnti dkasih tau :)"@mazayalinda: Yg klo ada cenel busana muslim aku mau ikutan dong "@noviwahyu10: Model ! Pasti gk blh klo k
and the @mazayalinda and @noviwahyu10 matches my regex @\w*.
However, I need to get rid all of the string, except for those 2 words above. We need to do the negation, but I am confuses about combining 2 regex, which are the regex to match the @[anyword] and the one to get rid all of the sentence except those 2 words.
Any ideas?
It seems to me that you want to use capturing groups, not exactly negate the rest of the string, a regex like:
Will capture those entries in capturing groups, and then, depending on your language, you can access each of the captured strings: http://rubular.com/r/qHKb35OK3g