fork download
  1. a <- c("this is a number 9999333333 and i got 12344")
  2. gsub("(?:\\G(?!^)|(?<!\\d)\\d{5})\\K\\d", "X", a, perl=TRUE)
Success #stdin #stdout 0.25s 39184KB
stdin
Standard input is empty
stdout
[1] "this is a number 99993XXXXX and i got 12344"