
mystring <- c("000450")
gsub("\\G0", "x", mystring, perl=TRUE)