I need to one give me the string between ~ and ^. I have a string like this:
~
^
~~~~ ABC ^ DEF ^ HGK > LMN ^
I
I'm not sure exactly what result is desired, but perhaps this?
>>> matchObj = re.findall(r'~+(.*?)\^', target) >>> print(matchObj) [' ABC ']