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\\\\\" \\
+
>>> import re
>>> text_1 = r""" "Some text on \"two\" lines with a backslash escaped\\" \
+ "Another text on \"three\" lines" """
>>> text_2 = r""" "Some text on \"two\" lines with a backslash escaped\\" + "Another text on \"three\" lines" """
>>> re.findall(r'\\"([^"]+)\\"', text_2)
['two', 'three']
>>> re.findall(r'\\"([^"]+)\\"', text_1)
['two', 'three']
Perhaps you want this:
re.findall(r'\\"((?:(?