Q:

RegEx with Python: findall inside a boundry

I have a string that can be ilustrated by the following (extraspaces intended):
"words that don't matter   START    some words one       some words two     some words three   END    words that don't matter"

To grab each substring between START and END ['some words one', some words two', 'some words three'], I wrote the following code:
result = re.search(r'(?<=START).*?(?=END)', string, flags=re. S).group()
result = re.findall(r'(\(?\w+(?:\s\w+)*\)?)',  result)

Is it possible to achieve this with one single regex? 

A:

With the newer regex module, you can do it in one step:
(?: \G(?!\A)|START)\s*\K
(?! \bEND\b)
\w+\s+\w+\s+\w+

This looks complicated, but broken down, it says:
(?: \G(?!\A)|START)  # look for START or the end of the last match
\s*\K               # whitespaces, \K "forgets" all characters to the left
(?! \bEND\b)         # neg.  lookahead, do not overrun END
\w+\s+\w+\s+\w+     # your original expression

In Python this looks like:
import regex as re

rx = re.compile(r'''
        (?: \G(?!\A)|START)\s*\K
        (?! \bEND\b)
        \w+\s+\w+\s+\w+''', re. VERBOSE)

string = "words that don't matter   START    some words one       some words two     some words three   END    words that don't matter"

print(rx.findall(string))
# ['some words one', 'some words two', 'some words three']

Additionally, see a demo on regex101.com.