正则表达式,又称规则表达式。(英语:Regular Expression,在代码中常简写为regex、regexp或RE),计算机科学的一个概念。正则表达式通常被用来检索、替换那些符合某个模式(规则)的文本。 正则表达式的特点是: 1. 灵活性、逻辑性和功能性非 常强; 2. 可以迅速地用极简单的方 ...
分类:
其他好文 时间:
2019-11-02 09:28:52
阅读次数:
79
老爸一看成绩单, 听我这么一说, 非常开心, 儿子有进步呀, 从40多名进步到30多名,进步很大, 躲过了一顿海扁。 想想看, 如果我还要增加其他的修饰条件, 是不是就非常容易了, 只要实现Decorator类就可以了! 这就是装饰模式。17.2 装饰模式的定义装饰模式(Decorator Patt ...
分类:
其他好文 时间:
2019-11-01 20:27:47
阅读次数:
78
python中decorator装饰器 语法示例: 什么是装饰器: 示例: 方法1:直接修改原函数的定义 有没有更简单的方法? 方法2:通过高阶函数返回新函数(装饰器函数): 调用1: 调用2: 装饰器: python内置@语法就是为了简化装饰器调用 等同于: 装饰器的作用: 装饰器示例: 1. 如 ...
分类:
编程语言 时间:
2019-11-01 16:14:32
阅读次数:
112
290. Word Pattern Easy Easy Easy Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that the ...
分类:
其他好文 时间:
2019-11-01 16:03:27
阅读次数:
87
Python中的re模块 pattern=re.complie #打包模式,以下三种均可以使用pattern re.sub#替换 re.findall#查找所有的匹配 re.split#分割 ret=re.search(pattern,str)#从任意位置匹配 ret.group()#对应的匹配值 ...
分类:
编程语言 时间:
2019-11-01 14:37:32
阅读次数:
104
aspectAnnotation的切面信息,加到了AnnotationAwareAspectJAutoProxyCreator的advisorsCache属性里面去了。 解析annotationServiceImpl的时候(此时AspectAnnotation还没有解析),resolveBefore ...
分类:
编程语言 时间:
2019-11-01 14:36:05
阅读次数:
78
import redef build_match_and_apply_functions(pattern, search, replace): def matches_rule(word): return re.search(pattern, word) def apply_rule(word): ...
分类:
编程语言 时间:
2019-11-01 12:37:04
阅读次数:
186
1.工厂模式简介 In class based programming, the factory method pattern is a creational pattern that uses factory methods to deal with the problem of creating ...
分类:
其他好文 时间:
2019-11-01 00:02:24
阅读次数:
111
1.NoReverseMatch at / Reverse for 'about' not found. 'about' is not a valid view function or pattern name. 这是因为自己指定了app_name, 在html界面中同样要指定,即 ...
分类:
其他好文 时间:
2019-10-31 23:48:43
阅读次数:
118
auth模块 + 插拔式思想 一、auth模块 ? django为方便实现用户功能,包括登陆注册注销修改信息等,提供了auth模块,实现操作简单化。 1.1 常用方法 ? 超级用户: ? authenticate():用户认证,认证成功会返回User对象,不成功返回None ? login(Http ...
分类:
其他好文 时间:
2019-10-31 23:32:21
阅读次数:
94