假设我们有一个字符串
string="This is a test code [asdf -wer -a2 asdf] >(ascd asdfas -were)\
test \
(testing test) test >asdf \
test"
我需要获取字符 > 和字符串“test”之间的字符串。
我尝试过:
re.findall(r'>[^)](.*)test',string, re.MULTILINE )
然而,我得到了:
(ascd asdfas -were)\ test \ (testing test) test >asdf.
然而我需要:
(ascd asdfas -were)\
与
asdf
我该如何获得这两个字符串?