The mechanisms that control the activation and repression of genes and the regulation of their expression.