Spectral functions for regular Sturm-Liouville problems