On Sep 21, 2:44 pm, David <wizza... at gmail.com> wrote: > > data = "asdfasgSTARTpruyerfghdfjENDhfawrgbqfgsfgsdfg" > > x = re.compile('START.END', re.DOTALL) > > This should work: > > x = re.compile('START(.*)END', re.DOTALL) You'll want to use a non-greedy match: x = re.compile(r"START(.*?)END", re.DOTALL) Otherwise the . will match END as well.