Many problems in systems and control theory require the solution of Sylvesterâ€™s equation

$AX-YB=C$ or of its generalization

$(*)$ $AXB+CYD=E$. The author studies the couple of matrix equations

$(**)$ ${A}_{1}X{B}_{1}={C}_{1},{A}_{2}X{B}_{2}={C}_{2}$ over an arbitrary regular ring with identity. He obtains necessary and sufficient conditions for the consistency of the system

$(**)$ and presents its general solution. The results are used to obtain necessary and sufficient conditions for the consistency of the equation

$(*)$ and to derive the form of its general solution.