Traditional auditory oddball paradigms imply the brain's ability to encode regularities, but are not optimal for investigating the process of regularity establishment. In the present study, a dynamic experimental protocol was developed that simulates a more realistic auditory environment with changing regularities. The dynamic sequences were included in a distraction paradigm in order to study regularity extraction and application. Subjects discriminated the duration of sequentially presented tones. Without relevance to the task, tones repeated or changed in frequency according to a pattern unknown to the subject. When frequency repetitions were broken by a deviating tone, behavioral distraction (prolonged reaction time in the duration discrimination task) was elicited. Moreover, event-related brain potential components indicated deviance detection (mismatch negativity), involuntary attention switches (P3a), and attentional reorientation. These results suggest that regularities were extracted from the dynamic stimulation and were used to predict forthcoming stimuli. The effects were already observed with deviants occurring after as few as two presentations of a standard frequency, that is, violating a just emerging rule. Effects of regularity violation strengthened with the number of standard repetitions. Control stimuli comprising no regularity revealed that the observed effects were due to both improvements in standard processing (benefits of regularity establishment) and deteriorations in deviant processing (costs of regularity violation). Thus, regularities are exploited in two different ways: for an efficient processing of regularity-conforming events as well as for the detection of nonconforming, presumably important events. The present results underline the brain's flexibility in its adaptation to environmental demands.