string = "hey there guy you"
# convert string to list
strlst = string[0:].split(' ')
# convert string to dictionary
strdict = dict(enumerate(string[0:].split(' ')))
# find position of words in strlst
for i in strdict:
if strdict[i] == "hey":
firstword = i + 1
if strdict[i] == "guy":
secondword = i
# here's your answer
answer = strlst[firstword:secondword]
print(answer)
import re
s = "hey there guy you hey there are no guy you"
result = re.findall(r"hey\s(.*?)\sguy", s)
#result == ["there", "there are no"]