I got the expected when i did re.findall(r'applepast[ry|e]', s17)
but i am not able understand why i need to give +
here, because alread explicitly i am giving e|ry
import re
s17 = 'find word that match applepastry, applepie or applepaste'
re.findall(r'applepast[ry|e]', s17)
My Out
['applepastr', 'applepaste']
My Expected
['applepastry', 'applepaste']