Let's say you want to extract the text between two given words. Here is one way, at first we look at it step by step, and then we combine all the steps to one line of code:
# find the text between two given words
str1 = "the quick brown fox jumps over the lazy dog."
word1 = "the"
word2 = "fox"
# do it one step at a time ...
# first split
part1 = str1.split(word1, 1)
print part1 # ['', ' quick brown fox jumps over the lazy dog.']
print part1[-1] # ' quick brown fox jumps over the lazy dog.'
# second split
part2 = part1[-1].split(word2, 1)
print part2 # [' quick brown ', ' jumps over the lazy dog.']
print part2[0] # ' quick brown '
print '-'*40
# combine it all ...
print str1.split(word1, 1)[-1].split(word2, 1)[0] # ' quick brown '