finish format string validation and expansion code