xyzjr 发表于 2018-8-12 09:52:35

python 正则匹配的re.search 例子

#!/usr/bin/env python  
#coding:utf-8
  
import re
  
err=("stderr: 'Permission denied (publickey) fatal: Could not read from remote repository")
  
matchpro = re.search( r'Permission denied \(publickey\)', err, re.M|re.I)
  
print matchpro.group()
页: [1]
查看完整版本: python 正则匹配的re.search 例子