2019-09-08

Python - Get string in between two other sub-strings

import re
s = 'STRING_PART_1This is the text you will getSTRING_PART_2'
result = re.search('STRING_PART_1(.*)STRING_PART_2', s)
print result.group(1)

No comments:

Post a Comment