Insects use two main modes of segment determination during development: the ancestral short-germband mode (eg. Gryllus bimaculatus) where new segments are added sequentially, and the more derived long-germband mode (eg. Drosophila melanogaster), where all segments are determined simultaneously. In dipteran insects (flies, midges and mosquitoes), which use the long-germband mode of segmentation, the gap genes are activated by maternal gradients and cross-regulate each other to form the first zygotic layer of regulation in the segmentation gene hierarchy. We reverse-engineered a dynamical model of the gap genes in D. melanogaster from quantitative spatio-temporal expression data and used it to characterise the dynamics of gap gene pattern formation along the embryo trunk. We used tools and concepts from dynamical systems theory, coupled with a newly developed methodology designed specifically to address the effect of maternal gradient dynamics in the patterning process. This approach showed that two distinct dynamical regimes govern anterior and posterior trunk patterning. Stationary domain boundaries in the anterior rely on multi-stability. In contrast, the observed anterior shifts of posterior gap gene domains can be explained as an emergent property of an underlying regulatory mechanism implementing a damped oscillator. We have identified a dual-function three-gene motif embedded in the gap gene regulatory network, which is sufficient to recover both anterior and posterior dynamical regimes. Which one drives gene expression in a given region depends on the gap genes involved. Interestingly, this sub-network - known as the AC/DC motif - can also sustain oscillations. Oscillations are not found in the gap gene system but are characteristic of short-germband segmentation, suggesting that both modes share much more than previously thought. Studying the evolution of the gap gene network as an evolving dynamical system will tell us how oscillations could have arisen or ceased, and this will help us understand how long-germband segmentation might have repeatedly and independently evolved from the ancestral short-germband mode.