fork(1) download
  1. s <- c('week 01st', 'weeks 02nd', 'year2022week01st', 'week 4th')
  2. gsub("weeks?\\h*\\K0+(?=[1-9]\\d*[a-zA-Z])", '', s, perl=T)
  3.  
Success #stdin #stdout 0.23s 38920KB
stdin
Standard input is empty
stdout
[1] "week 1st"        "weeks 2nd"       "year2022week1st" "week 4th"