| 项目搜索 |
| |
|
代码片段库:
查看代码片段
浏览
| 提交新的代码片段
| 创建代码包
正规表达支持
|
类型:
Sample Code (HOWTO) |
类别:
File Management
|
许可证:
GNU Library Public License |
语言:
Python
|
描述:
Python 正规表达 功能片段
|
该代码片段的版本系列:
片段ID |
下载版本 |
提交时间 |
提交人 |
删除 |
4580 | 0.9.b | 2002-07-30 09:08 | zoomquiet | |
点击"下载版本"来下载该代码片段.
最新版本的代码片段: 0.9.b
import re
class xfilter:
def __init__(self):
self._zdologo=""
self.re_match_br=re.compile(
r"""(<br>) #(?!=/>|</link>)#要求在某个HTML标签内部
""", # and if followed at some point by 'salad'',
re.IGNORECASE | # allow pepper, Pepper, PEPPER, etc.
re.DOTALL | # allow to match newlines as well
re.VERBOSE) # this allows the comments and the newlines above
...
# 文本源 正则过滤器
def xfilter(self,_fobj,_match,_mname):
_fixli=[] #转换寄存列表
_mlist=_match.findall(_fobj)
if(len(_mlist)==0): return 0
else:
return _mlist
.......
如果您修改了一个代码片段并且觉得很应该让别人共享,您可以把这作为这个代码片段的最新版本提交上来. |
|