Global vision Mainland & lt;/span> This is a bunch of web page source, I want to capture & lt; Li> And & lt;/li> Between content, but I use a regular match but cannot get to intercept, seek advice
The code below
CodePudding user response:
re. The.findall (... , re DOTALL) CodePudding user response:
reference 1st floor chuifengde response: re. The.findall (... Re. DOTALL) This is ok?? CodePudding user response:
After I search, because the original. Can match the newline character of any character, and have the newline need further step Result=re. The.findall (' & lt; Li> ([\ s \ s] *) & lt;/li> ', a)Print (result) CodePudding user response:
references to son reply: 3/f after I search, because the original. Can match the newline character of any character, and have the newline need further step Result=re. The.findall (' & lt; Li> ([\ s \ s] *) & lt;/li> ', a)Print (result) Yeah, the result=re. The.findall (' & lt; Li> ([\ s \ s] *) & lt;/li> ', a, re. DOTALL) add a sign behind can normal recognition