I have a text file which has multiple strings between '-', and i'm trying to print every string that is between '-'
I have tried this code but, it's skipping values.
import re
text= """
-text1-text2-text3
-text4-
"""
result = re.findall(r'-(.*?)-', text)
print(result,end="")
I'm trying to get the result to come up like this:
['text1','text2','text3'],'text4']
but instead my code is skipping values and giving me this:
['text1','text4']
