I have a string like this:
str='< TOPICS>< D>cocoa< /D>< /TOPICS>< PLACES>< D>el-salvador< /D>< D>usa< /D>< D>uruguay< /D>< /PLACES>'
I want to get the string between < D> and < /D> in < PLACES> and < /PLACES>. I have known the flowing:
p1=re.compile(r'(?<=<PLACES>)(.*?)(?=</PLACES>)')
p2=re.compile(r'(?<=<D>)(.*?)(?=</D>)')
with p1 and p2,I can get el-salvador,usa,uruguay.But how can I get the info with only a p.