I am looking for a manner to extract the position of "*" and "+" symbols in R string.
test <- "x+y"
unlist(gregexpr("+", test))
[1] 1 2 3
unlist(gregexpr("y", test))
[1] 3
It returns the position of x or y but returns all positions for + or *.
Thank you!