Find string between two substrings [duplicate]

This question already has answers here: How to extract the substring between two markers? (20 answers) Closed 3 years ago. How do I find a string between two substrings (‘123STRINGabc’ -> ‘STRING’)? My current method is like this: >>> start=”asdf=5;” >>> end = ‘123jasd’ >>> s=”asdf=5;iwantthis123jasd” >>> print((s.split(start))[1].split(end)[0]) iwantthis However, this seems very inefficient and … Read more