Here is string:
step into
1
2
step into
3
4
step out
when I run:
r = re.compile('step into[\s\S]*?step out').search(s).group()
I get:
step into
1
2
step into
3
4
step out
However, I want:
step into
3
4
step out
It seems I should make non-greedy regular search from right to left to get the right result. How can I do it with python?