Let's suppose I have a string: s = 'pa blah blah blah pa xxxtring pu'.
How can I get a string between pa and pu, but using the pa and pu that are near.
In this case I would like to get output: 'xxxstring'
I used re.search('pa (.+?) pu',s).group(1), but as a result I got 'blah blah blah pa xxxtring' which is not what I wanted.