Editplus 正则替换

EditPlus supports following regular expressions in Find, Replace and Find in Files command.

 
ExpressionDescription
/tTab character.
/nNew 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.
/Escape character. If you want to use character "/" itself, you should use "//".


The tagged expression is enclosed by (). Tagged expressions can be referenced by /0, /1, /2, /3, etc. /0 indicates a tagged expression representing the entire substring that was matched. /1 indicates the first tagged expression, /2 is the second, etc. See following examples.

Original    Search     Replace     Result
abc     (ab)(c)    /0-/1-/2    abc-ab-c
abc     a(b)(c)    /0-/1-/2    abc-b-c
abc     (a)b(c)    /0-/1-/2    abc-a-c

From Editplus Manual Help

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值