A regioselective route to 5-substituted pyrazole- and pyrazoline-3-phosphonic acids and esters