fork download
  1. library(stringr)
  2. x <- c("fair*", "beaut*")
  3. str_replace(x, "(.*)\\*$", "^\\1")
  4. sub("(.*)\\*$", "^\\1", x)
Success #stdin #stdout 0.27s 42344KB
stdin
Standard input is empty
stdout
[1] "^fair"  "^beaut"
[1] "^fair"  "^beaut"