The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font fo...
分类:
其他好文 时间:
2015-01-28 19:41:56
阅读次数:
173
Web Client Software Factory系列(3):View-Presenter模式作者: TerryLee.NET设计模式(18):迭代器模式(Iterator Pattern)作者: TerryLee.NET设计模式(19):观察者模式(Observer Pattern)作者: T...
分类:
其他好文 时间:
2015-01-28 17:47:59
阅读次数:
478
正则表达式的构造摘要(常用): ------其他的构造请参看API-Pattern类构造匹配字符x字符 x\\反斜线字符\0n带有八进制值 0 的字符 n (0<=n<=7)\0nn带有八进制值 0 的字符 nn (0<=n<=7)\0mnn带有八进制值 0 的字符 mnn(0<=m<=3、0<=n...
分类:
其他好文 时间:
2015-01-28 17:30:48
阅读次数:
204
1. Sed简介
sed 是一种在线编辑器,它一次处理一行内容。处理时,把当前处理的行存储在临时缓冲区中,称为“模式空间”(pattern space),接着用sed命令处理缓冲区中的内容,处理完成后,把缓冲区的内容送往屏幕。接着处理下一行,这样不断重复,直到文件末尾。文件内容并没有 改变,除非你使用重定向存储输出。Sed主要用来自动编辑一个或多个文件;简化对文件的反复操作;编写...
分类:
系统相关 时间:
2015-01-28 15:58:44
阅读次数:
219
题目链接:ZigZag Conversion
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)
...
分类:
其他好文 时间:
2015-01-28 14:45:26
阅读次数:
93
标题:ZigZag Conversion通过率:22.7%难度:简单The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to displ...
分类:
其他好文 时间:
2015-01-28 14:23:47
阅读次数:
129
1 语法 1.1 直接量语法 /pattern/attributes 1.2 创建RegExp对象 new RegExp(pattern,attributes) 1.3 说明 pattern是正则表达式,attributes是指修饰符如i,g,m2 RegExp 对象方法方法描述exec...
分类:
Web程序 时间:
2015-01-28 14:20:36
阅读次数:
187
题目:The string "PAYPALISHIRING" is written
in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)
P A H N
A P L S...
分类:
其他好文 时间:
2015-01-27 18:26:07
阅读次数:
184
今天主要看下re.sub函数和Handler类的sub函数
先看下re.sub函数
re.sub共有5个参数,不过一般写前三个就好了,即pattern,repl和string
pattern表示正则中的模式字符串,repl可以是字符串,也可以是函数。string为要进行替换的字符串
先看一段代码:
import re
def Num2A(match):
return 'A'
a...
分类:
编程语言 时间:
2015-01-27 16:28:12
阅读次数:
219
题目:The string "PAYPALISHIRING" is written
in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)
P A H N
A P L S...
分类:
其他好文 时间:
2015-01-27 16:26:55
阅读次数:
172