r - remove all words that start with "@" from a string -


how can remove words start "@" string?

for example, "@agnezmo on @airasia airbus a320-216 fleet @ninetologymy livery -- 9m-ahg cc: @agnesmonicaent @agnezone http://t.co/hfxwuqq2oq"

i have string "on airbus a320-216 fleet livery -- 9m-ahg cc: http://t.co/hfxwuqq2oq"

try s input:

gsub("@\\w+ *", "", s) 

giving:

"on airbus a320-216 fleet livery -- 9m-ahg cc: http://t.co/hfxwuqq2oq" 

Comments

Popular posts from this blog

rest - Spring boot: Request method 'PUT' not supported -

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

symfony - imagine_filter() not generating the correct url in LiipImagineBundle -