fork download
  1. x <- c('2020M6','2020M10')
  2. sub("(M)([0-9])$", "\\10\\2", x)
  3. sub("(M)([0-9])$", "\\10\\2", x, perl=TRUE)
  4.  
Success #stdin #stdout 0.25s 39604KB
stdin
Standard input is empty
stdout
[1] "2020M06" "2020M10"
[1] "2020M06" "2020M10"