5
Jun.2008
上万条的数据用EditPlus做批处理,原以为不能多行替换,结果累了两天,因为不懂得正则表达式,所以效率超低,今天找到了一些实例和教程,用之,真是太方便了,速度之快,好用,记录之~
正则表达式是一个查询的字符串,它包含一般的字符和一些特殊的字符,特殊字符可以扩展查找字符串的能力,正则表达式在查找和替换字符串的作用不可忽视,它能很好提高工作效率。
首先贴出测试工具:
Javascript正则表达式在线测试工具
正则表达式是一个包含普通文本加上指示为扩展特殊字符的搜索字符串的搜索选项。正则表达式允许更多的高级搜索和替换。
例如,您可以使用正则表达式“[0-9]”查找任何的数字。同样地您可以使用正则表达式“[^0-9]”查找任何匹配的非数字的字符。
在查找、替换以及在文件中查找命令中,EditPlus 支持下列的正则表达式。
表达式 描述
\t 制表(跳格)字符。
\n 换行。
. 匹配任何字符。
| 在它的左边和右边的任何一个表达式匹配目标字符串。例如“a|b”匹配“a”和“b”。
[] 括号内的任何字符可能匹配目标字符。例如“[ab]”匹配“a”和“b”;“[0-9]”匹配任何数字。
[^] 括号内的没有任何字符可能匹配目标字符。例如“[^ab]”匹配“a”和“b”除外的所有字符;“[^0-9]”匹配任何非数字的字符。
* 在星号左边的字符在表达式中可能匹配 0 次或多次。例如“be*”匹配“b”,“be”和“bee”。
+ 在加号左边的字符在表达式中可能匹配 1 次或多次。例如“be+”匹配“be”和“bee”,但不匹配“b”。
? 在问号左边的字符在表达式中可能匹配 0 次或 1 次。例如“be?”匹配“b”和“be”,但不匹配“bee”。
^ 仅当 ^ 右边的表达式在行开始的位置时匹配。例如“^A”仅匹配在行开始位置的“A”。
$ 仅当 $ 左边的表达式在行结束的位置时匹配。例如“e$”仅匹配在行结束位置的“e”。
() 影响表达式的计算顺序同时也用来标记表达式。
\ 转义字符。若您要使用字符“\”本身,您必须使用“\\”。
已标记的表达式是由()围住的。标记的表达式可以被 \0、\1、\2、\3 等引用。\0 指示一个匹配完整子串的标记的表达式。\1 指示第一个标记的表达式,\2 是第二个,等等。查看下列的例子。
原文 搜索 替换 结果
abc (ab)(c) \0-\1-\2 abc-ab-c
abca (b)(c) \0-\1-\2 abc-b-c
abc (a)b(c) \0-\1-\2 abc-a-c
Editplus中无法使用{ } 标记限定符表达式的开始。如{n} 重复次
EditPlus的查找,替换,文件中查找支持以下的正则表达式:
例子:
正则表达式是一个查询的字符串,它包含一般的字符和一些特殊的字符,特殊字符可以扩展查找字符串的能力,正则表达式在查找和替换字符串的作用不可忽视,它能很好提高工作效率。
首先贴出测试工具:
Javascript正则表达式在线测试工具
引用
正则表达式是一个包含普通文本加上指示为扩展特殊字符的搜索字符串的搜索选项。正则表达式允许更多的高级搜索和替换。
例如,您可以使用正则表达式“[0-9]”查找任何的数字。同样地您可以使用正则表达式“[^0-9]”查找任何匹配的非数字的字符。
在查找、替换以及在文件中查找命令中,EditPlus 支持下列的正则表达式。
表达式 描述
\t 制表(跳格)字符。
\n 换行。
. 匹配任何字符。
| 在它的左边和右边的任何一个表达式匹配目标字符串。例如“a|b”匹配“a”和“b”。
[] 括号内的任何字符可能匹配目标字符。例如“[ab]”匹配“a”和“b”;“[0-9]”匹配任何数字。
[^] 括号内的没有任何字符可能匹配目标字符。例如“[^ab]”匹配“a”和“b”除外的所有字符;“[^0-9]”匹配任何非数字的字符。
* 在星号左边的字符在表达式中可能匹配 0 次或多次。例如“be*”匹配“b”,“be”和“bee”。
+ 在加号左边的字符在表达式中可能匹配 1 次或多次。例如“be+”匹配“be”和“bee”,但不匹配“b”。
? 在问号左边的字符在表达式中可能匹配 0 次或 1 次。例如“be?”匹配“b”和“be”,但不匹配“bee”。
^ 仅当 ^ 右边的表达式在行开始的位置时匹配。例如“^A”仅匹配在行开始位置的“A”。
$ 仅当 $ 左边的表达式在行结束的位置时匹配。例如“e$”仅匹配在行结束位置的“e”。
() 影响表达式的计算顺序同时也用来标记表达式。
\ 转义字符。若您要使用字符“\”本身,您必须使用“\\”。
已标记的表达式是由()围住的。标记的表达式可以被 \0、\1、\2、\3 等引用。\0 指示一个匹配完整子串的标记的表达式。\1 指示第一个标记的表达式,\2 是第二个,等等。查看下列的例子。
原文 搜索 替换 结果
abc (ab)(c) \0-\1-\2 abc-ab-c
abca (b)(c) \0-\1-\2 abc-b-c
abc (a)b(c) \0-\1-\2 abc-a-c
Editplus中无法使用{ } 标记限定符表达式的开始。如{n} 重复次
EditPlus的查找,替换,文件中查找支持以下的正则表达式:
Expression Description
\t Tab character.
\n New line.
. Matches any character.
| Either expression on its left and right side matches the target string.
For example, “a|b” matches “a” and “b”.
[] Any of the enclosed characters may match the target character.
For example, “[ab]” matches “a” and “b”. “[0-9]” matches any digit.
[^] None of the enclosed characters may match the target character.
For example, “[^ab]” matches all character EXCEPT “a” and “b”.
“[^0-9]” matches any non-digit character.
* Character to the left of asterisk in the expression should match 0 or more times.
For example “be*” matches “b”, “be” and “bee”.
+ Character to the left of plus sign in the expression should match 1 or more times.
For example “be+” matches “be” and “bee” but not “b”.
? Character to the left of question mark in the expression should match 0 or 1 time.
For example “be?” matches “b” and “be” but not “bee”.
^ Expression to the right of ^ matches only when it is at the beginning of line.
For example “^A” matches an “A” that is only at the beginning of line.
$ Expression to the left of $ matches only when it is at the end of line.
For example “e$” matches an “e” that is only at the end of line.
() Affects evaluation order of expression and also used for tagged expression.
\ scape character. If you want to use character “\” itself, you should use “\\”.
\t Tab character.
\n New line.
. Matches any character.
| Either expression on its left and right side matches the target string.
For example, “a|b” matches “a” and “b”.
[] Any of the enclosed characters may match the target character.
For example, “[ab]” matches “a” and “b”. “[0-9]” matches any digit.
[^] None of the enclosed characters may match the target character.
For example, “[^ab]” matches all character EXCEPT “a” and “b”.
“[^0-9]” matches any non-digit character.
* Character to the left of asterisk in the expression should match 0 or more times.
For example “be*” matches “b”, “be” and “bee”.
+ Character to the left of plus sign in the expression should match 1 or more times.
For example “be+” matches “be” and “bee” but not “b”.
? Character to the left of question mark in the expression should match 0 or 1 time.
For example “be?” matches “b” and “be” but not “bee”.
^ Expression to the right of ^ matches only when it is at the beginning of line.
For example “^A” matches an “A” that is only at the beginning of line.
$ Expression to the left of $ matches only when it is at the end of line.
For example “e$” matches an “e” that is only at the end of line.
() Affects evaluation order of expression and also used for tagged expression.
\ scape character. If you want to use character “\” itself, you should use “\\”.
例子:
28
May.2008
25
May.2008
你的样子 - 林志炫
下载
歌名:你的样子
歌手:林志炫
我听到传来的谁的声音
象那梦里呜咽中的小河
我看到远去的谁的步伐
遮住告别时哀伤的眼神
不明白的是为何你情愿
让风尘刻画你的样子
就象早已忘情的世界
曾经拥有你的名字我的声音
下载
歌名:你的样子
歌手:林志炫
我听到传来的谁的声音
象那梦里呜咽中的小河
我看到远去的谁的步伐
遮住告别时哀伤的眼神
不明白的是为何你情愿
让风尘刻画你的样子
就象早已忘情的世界
曾经拥有你的名字我的声音
4
May.2008
1
May.2008
dz升级检测功能的黑盒测试
by superhei 2007-09-08 http://www.ph4nt0m.org
'dz的论坛程序升级通知'是个不错的功能,很多注意安全的程序都有类似的功能,比如:wordpress
我们先看看dz功能的实现代码 :
\admin\global.func.php
提交版本以及一些论坛的信息利用js发送到customer.discuz.net来判断,我们抓个包:
by superhei 2007-09-08 http://www.ph4nt0m.org
'dz的论坛程序升级通知'是个不错的功能,很多注意安全的程序都有类似的功能,比如:wordpress
我们先看看dz功能的实现代码 :
\admin\global.func.php
00438: echo ''.rawurlencode(DISCUZ_VERSION).'&release='.rawurlencode(DISCUZ_RELEASE).'&php='.PHP_VERSION.'&mysql='.$dbversion.'&charset='.rawurlencode($charset).'&bbname='.rawurlencode($bbname).'&members='.$members.'&threads='.$threads.'&posts='.$posts.'&msn='.$msns.'&md5hash='.md5(preg_replace("/http:\/\/(.+?)\/.*/i", "\\1",
$_SERVER['HTTP_REFERER']).$_SERVER['HTTP_USER_AGENT'].DISCUZ_VERSION.DISCUZ_RELEASE.$bbname.$members.$threads.$posts).'">';
$_SERVER['HTTP_REFERER']).$_SERVER['HTTP_USER_AGENT'].DISCUZ_VERSION.DISCUZ_RELEASE.$bbname.$members.$threads.$posts).'">';
提交版本以及一些论坛的信息利用js发送到customer.discuz.net来判断,我们抓个包:
30
Apr.2008
Je sais pas是Celine Dion 席林 迪翁 发布的专辑[On Ne Change Pas 我们不会改变]中的一首歌曲
很喜欢她的演唱风格,看过的电影《铁达尼号》(泰坦尼克号)的都知道里面那首经典的主题曲《My Heart Will Go On》,就是她演唱的
文件都比较大,可能会慢一点,请耐心等待。。。
试听地址1(法国)
试听地址2(国内)
曲 名: Je Sais Pas
演 唱: Celine Dion
专 辑: On Ne Change Pas
很喜欢她的演唱风格,看过的电影《铁达尼号》(泰坦尼克号)的都知道里面那首经典的主题曲《My Heart Will Go On》,就是她演唱的
文件都比较大,可能会慢一点,请耐心等待。。。
试听地址1(法国)
试听地址2(国内)
曲 名: Je Sais Pas
演 唱: Celine Dion
专 辑: On Ne Change Pas
29
Apr.2008
真的很好听的音乐,请欣赏...
试听地址1:
这个文件比较小,速度比较快,同时也音质一般;
试听地址2:
这个音质好一些,同时速度也有点慢.
试听地址3:
挪威美女歌手Maria Arredondo( burning )清晰mtv
Flash Player文件
[quote]
Burning - Maria Arredondo
[color=#2E8B57] Passion is sweet
Love makes weak
You said you cherished freedom so
You refuse to let it go
试听地址1:
这个文件比较小,速度比较快,同时也音质一般;
试听地址2:
这个音质好一些,同时速度也有点慢.
试听地址3:
挪威美女歌手Maria Arredondo( burning )清晰mtv

[quote]
Burning - Maria Arredondo
[color=#2E8B57] Passion is sweet
Love makes weak
You said you cherished freedom so
You refuse to let it go