How to remove " 's" in a string?
Use
['’]s\b|[^[:alnum:][:blank:]@_]
See the regex demo.
Details
['’]s\b
-'
or’
and thens
at the end of a word|
- or[^[:alnum:][:blank:]@_]
- any char but an alphanumeric, horizontal whitespace,@
or_
char
R demo:
> x <- c("@kyrieirving’s", "@jaytatum0")
> gsub("['’]s\\b|[^[:alnum:][:blank:]@_]", "",x)
[1] "@kyrieirving" "@jaytatum0"
follower.list = c("@kyrieirving’s", "@jaytatum0")
gsub("\\’s$",'',follower.list)