#/usr/bin/python
#coding=utf-8
#@Time   :2017/11/14 9:55
#@Auther :liuzhenchuan
#@File   :编译正则对象.py
 
# 正则匹配时,优先编译成正则对象,然后进行匹配,这样程序的效率要高
import re
 
reg = re.compile(r'abc.*')
print type(reg)
print reg
 
 
 
>>>
<type '_sre.SRE_Pattern'>
<_sre.SRE_Pattern object at 0x0322B0B8>

相关文章:

  • 2021-11-05
  • 2021-08-16
  • 2021-10-18
  • 2021-10-03
  • 2022-01-05
  • 2022-12-23
  • 2021-10-16
猜你喜欢
  • 2022-12-23
  • 2022-01-30
  • 2022-01-12
  • 2021-07-14
  • 2022-03-03
  • 2021-06-10
  • 2022-12-23
相关资源
相似解决方案