Anomalous microwave emission (AME) has been observed by numerous experiments in the frequency range ∼10-60 GHz. Using Planck maps and multi-frequency ancillary data, we have constructed spectra for two known AME regions: the Perseus and ρ Ophiuchi molecular clouds. The spectra are well fitted by a combination of free-free radiation, cosmic microwave background, thermal dust, and electric dipole radiation from small spinning dust grains. The spinning dust spectra are the most precisely measured to date, and show the high frequency side clearly for the first time. The spectra have a peak in the range 20-40 GHz and are detected at high significances of 17.1σ for Perseus and 8.4σ for ρ Ophiuchi. In Perseus, spinning dust in the dense molecular gas can account for most of the AME; the low density atomic gas appears to play a minor role. In ρ Ophiuchi, the ∼30 GHz peak is dominated by dense molecular gas, but there is an indication of an extended tail at frequencies 50-100 GHz, which can be accounted for by irradiated low density atomic gas. The dust parameters are consistent with those derived from other measurements. We have also searched the Planck map at 28.5 GHz for candidate AME regions, by subtracting a simple model of the synchrotron, free-free, and thermal dust. We present spectra for two of the candidates; S140 and S235 are bright H ii regions that show evidence for AME, and are well fitted by spinning dust models.