May-15-2020, 09:59 PM
You could use a regex.
>>> s = "djfk83dhfdog83748djfk83dhfcat83748djfk83dhfmonkey83748djfk83dhfhuman83748" >>> import re >>> re.findall(r"djfk83dhf(.+?)83748", s) ['dog', 'cat', 'monkey', 'human']