美文网首页
常用正则

常用正则

作者: JOHY119 | 来源:发表于2018-12-07 14:08 被阅读0次
# 匹配markdown中代码块
re.findall(r'```(?:\w*?\s)(.*?)```',post,flags=re.DOTALL)

# 匹配url
    matches1 = re.findall(r'((?:https?|ftp)://.*?)[\s)>]',post)

相关文章

网友评论

      本文标题:常用正则

      本文链接:https://www.haomeiwen.com/subject/sgsthqtx.html