REGEX-String and escaped quote

后端 未结 4 1874
你的背包
你的背包 2020-12-19 12:05

How to get what is between the quotes in the following two texts ?

text_1 = r\"\"\" \"Some text on \\\"two\\\" lines with a backslash escaped\\\\\" \\
     +         


        
4条回答
  •  旧巷少年郎
    2020-12-19 12:21

    >>> import re
    >>> text = "Some text on\n\"two\"lines" + "Another texton\n\"three\"\nlines"
    >>> re.findall(r'"(.*)"', text)
    ["two", "three"]
    

提交回复
热议问题