Anion-exchange behaviour of the alkaline earth metals