Add ~x.y.z and ^x.y.z parsing

(oh, and these 'behaviour's should be "behavior" instead.)