I think in this case you have to use the str_extract from that you can extract the first special character.
library(stringr)
str_extract(a$name,'[[:punct:]]')
#[1] NA "'" "_" NA "%" "_" "@"
If you want all of the special characters, in that case use str_extract_all.
sapply(str_extract_all(a$name,'[[:punct:]]'), function(x) toString(unique(x)))
#[1] "" "'" "_" "" "%" "_, !" "@, !"
And to exclude some symbols, use the below code:
exclude_symbol <- c('-', '.', '/', '&', ',')
sapply(str_extract_all(a$name,'[[:punct:]]'), function(x)
toString(setdiff(unique(x), exclude_symbol)))
If you are a beginner and want to know more R then do check out the R programming course that will help you in understanding R from scratch.