import re
string = '<h4 class="title">愤怒的葡萄</h4>'
pattern = '<h4 class="title">(.*?)</h4>'
# pattern = '.*?\s'
s = re.compile(pattern).findall(string)
print(s)

re.compile匹配

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
  • 2022-12-23
  • 2021-12-09
  • 2021-05-19
  • 2021-08-07
猜你喜欢
  • 2021-07-18
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
  • 2021-06-28
  • 2021-07-22
  • 2021-11-29
相关资源
相似解决方案