Regiospecific synthesis of 3-substituted imidazo[1,2-a]pyridines, imidazo[1,2-a]pyrimidines, and imidazo[1,2-c]pyrimidine.