lettersToDigits = (s) =>
s
.replace(/^\D*twone/, "2ne")
.replace(/^\D*eightwo/, "8wo")
.replace(/^\D*eighthree/, "8hree")
.replace(/^\D*nineight/, "9ight")
.replace(/oneight\D*$/, "on8")
.replace(/threeight\D*$/, "thre8")
.replace(/fiveight\D*$/, "fiv8")
.replace(/one/g, "1")
.replace(/two/g, "2")
.replace(/three/g, "3")
.replace(/four/g, "4")
.replace(/five/g, "5")
.replace(/six/g, "6")
.replace(/seven/g, "7")
.replace(/eight/g, "8")
.replace(/nine/g, "9")