The input can contain overlapping digits such as “twone”, so we only remove a letter at a time until the starting or ending digits are found.