i am extracting text from a pdf and i want to search for an expression like P50+P60, but in the text there are also terms like P50+P40+P30. How can i implement, that i just find a Structure like Pxx+Pxx (x=digit) and there is nothing found for Pxx+Pxx+Pxx.
I tried it like this
List = re.findall('(P\d\d+P\d\d[^\+P\d\d])', String)
but this shows also the P50+P40 from the term P50+P40+P30. I tried a lot but couldn't fix the problem.