I have string bellow
object1: {
a: 'text a',
b: 'text b',
},
object2: {
a: 'text2 a',
b: 'text2 b',
}
I have regex
r"(object1|object2):\s\{(?:.*?)(\w+):\s[\'\"]text2 b[\'\"]" with flags re.DOTALL
I expected is ('object2', 'b')
But actual is ('object1', 'b')