<p class="body">
Giving the meeting of NITI Aayog in New Delhi a miss, West Bengal Chief Minister and Trinamool Congress chairperson Mamata Banerjee said in Bardhaman on Wednesday that the Centre should withdraw the land acquisition ordinance.
</p>
只是为了得到<p class="body">
和</p>
之间的内容
re.search(">(.+?)<",text)
返回None
默认情况下,
.
不包含新行,因此当前正则表达式不匹配。你知道吗这个文档有一个修饰符列表,可以用来改变regex的函数https://docs.python.org/2/library/re.html#re.S。你知道吗
因此
.+?
只匹配以下内容而不匹配修饰符:使用修饰符,您将获得:
不过,您应该考虑为此使用解析器。此正则表达式将因搜索字符串中的任何其他元素而失败,例如:
您可以在操作here中看到这一点。你知道吗
相关问题 更多 >
编程相关推荐