stringA = 'xxxxxxFoundAaaaaaaaaaaaaaaFoundBxxxxxxx'
stringB = 'FoundA'
stringC = 'FoundB'
import re
re.search(re.escape(stringB) + '(.*?)' + re.escape(stringC), stringA).group(1)
Python match and return string in between