fork download
  1. x <- c("3818119", "0M11936", "0X11087", "0T05060")
  2. sub("^0([[:alpha:]])", "\\1", x)
  3. sub("^0([A-Z])", "\\1", x)
  4. sub("^0(?=[A-Z])", "", x, perl=TRUE)
Success #stdin #stdout 0.26s 39640KB
stdin
Standard input is empty
stdout
[1] "3818119" "M11936"  "X11087"  "T05060" 
[1] "3818119" "M11936"  "X11087"  "T05060" 
[1] "3818119" "M11936"  "X11087"  "T05060"