Archive for 2008 年 3 月 4 日

Editplus 正则替换实例 By Stabx

0

abandon[2'b9nd2n]v.抛弃,放弃
abandonment[2'b9nd2nm2nt]n.放弃
abbreviation[2bri:vi'ei62n]n.缩写
abeyance[2'bei2ns]n.缓办,中止
abide[2'baid]v.遵守
ability[2'biliti]n.能力
able['eibl]adj.有能力的,能干的
abnormal[9b'n0:m2l]adj.反常的,变态的
aboard[2'b0:d]adv.船(车)上

1.
查找: (^[a-zA-Z0-0-]+)([*.*]+)(.*)
替换: @@@@@”1″,”2″,”3″,
效果:
(更多…)

EditPlus正则表达式替换字符串详解

0

网上搜集了些实例

正则表达式是一个查询的字符串,它包含一般的字符和一些特殊的字符,特殊字符可以扩展查找字符串的能力,正则表达式在查找和替换字符串的作用不可忽视,它能很好提高工作效率。

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 “”.

例子:

(更多…)

Go to Top