Python regex look-behind requires fixed-width pattern

前端 未结 5 1692
甜味超标
甜味超标 2020-12-19 03:28

When trying to extract the title of a html-page I have always used the following regex:

(?<=)([\\s\\S]*)(?=)
<
5条回答
  •  旧巷少年郎
    2020-12-19 03:55

    What about something like:

     r = re.compile("()([\s\S]*)()")
     title = r.search(page).group(2)
    

提交回复
热议问题