We study the hypoellipticity of (pseudo)differential operators in one variable when a positivity assumption is made on a suitable principal part. We prove that the found Gevrey regularity is optimal.