Home > other >  How to use regular expressions to extract the text in the following two code
How to use regular expressions to extract the text in the following two code

Time:10-05

Novice to practice climb the post bar, book is 17 years, to meet the following two section of the web page code, not with regular expressions, how can I put the inside of the extracted from Chinese characters?

CodePudding user response:

 

Def test_re () :
The import re
Test_html="'



Question points: 20 points & lt;/span>
"'
The pattern=re.com running (r '& lt; [^ & gt;] +> 're. S)
Result=pattern. Sub (' ', test_html)
Print (result)


Test_re ()

  • Related