In higher eukaryotes, genes are expressed dynamically in complex spatial and temporal patterns, which are progressively refined to set up body plans and define specific cell types. The information about when and where each gene is to be expressed is encoded in the sequences of promoter and enhancer regions and realized by transcription factor and cofactor proteins. Using an interdisciplinary approach in Drosophila, we functionally characterize regulatory sequences by enhancer screens and by assessing core promoter activities of large candidate libraries. We dissect the combinatorics of transcription factors and cofactors by directed tethering in enhancer complementation assays, which reveal functionally distinct classes of transcription factors. Finally, we study how enhancers and the cofactor proteins they recruit activate different types of core promoters, enabling distinct sets of genes and alternative promoters of the same genes to be regulated differently. The distinct compatibilities between cofactors and core promoters form the basis of specificity within and between gene regulatory programs.