Editplus的正则表达式
资料来源:Editplus Wiki
http://editplus.info/wiki/Regular_Expressions
http://editplus.info/wiki/Regular_expression_syntax
Regular Expressions 正则表达式
This page exists as a resource for Regular Expressions (also shortened as RegEx or RegExp) frequently used in EditPlus. In order to learn more about the particulars of creating a regular expression in EditPlus, see regular expression syntax. Also note that some standard regular expressions are currently not supported.
该网页说明了在EditPlus中常用的正则表达式(Regular Expressions,也通常缩写为RegEx 或 RegExp)。为了学习更多关于在EditPlus中生成正则表达式的详细说明,可以看正则表达式语法 。同时也要注意到有些标准的正则表达式目前还不支持。
Note: EditPlus only supports [POSIX] Regular Expressions, not [PCRE] (Perl-Compatible Regular Expressions), which means there are no back-references, no look-aheads, no fancy quantifiers, and no convenient character group syntax]]. Just your basic ^, $, +, *, ?, [ ], [^ ], syntax. Also note that +/* are always greedy.
注意:EditPlus只支持[POSIX]标准的正则表达式,二不是[PCRE](兼容Perl的正则表达式),这意味着EditPlus并不支持:回退引用、向前查找、花哨的量化词和方便的字符组语法(这些名词的翻译可能不准确,任何建议请回复本文,谢谢)。它只支持基本的^, $, +, *, ?, [ ], [^ ]等语法。还要主要到 +/* 总是很贪婪的。
Regular expression syntax 正则表达式语法
EditPlus supports Regular Expressions in search and replace, but its engine is not as feature-rich as others. A list of common regular expression features not available in EditPlus is available here. Please see Regular Expressions for some commonly used examples.
Operators and Syntax Supported in EditPlus 在EditPlus中支持的操作符和语法
- \
- escape (\ = \\) used for matching characters that have special meaning as regular expressions
- 转义符号,用于匹配那些作为正则表达式有特殊含义的字符(比如要匹配字符\,使用\\即可)
- ^
- (caret) beginning of line (assertion)
- 匹配一行的开始(插入)
- $
- end of line (assertion)
- 匹配一行的结束(插入)
- \t
- horizontal tab (0x09)
- 制表符(即对应ASCII代码0x09)
- \n
- newline (0x0A or 0x0D or 0x0D+0x0A)
- 新的一行(对应ASCII代码0x0A 或 0x0D 或 0x0D+0x0A)
- .
- (period) any character
- 代表任意字符
- ( )
- referencable grouping, see \0 - \9 below, e.g. (foo) matches "foo"
- 表达式分组标记,可引用的组,看后面的\0 - \9,例如(foo)匹配"foo"
- [ ]
- character class (or-list), e.g. [abc] matches "a", "b", or "c"
- 匹配字符集合或者字符列表中任意一个字符,例如 [abc] 匹配 "a", "b", 或 "c"
- [^ ]
- negated character class, e.g. [^abc] matches a character that is not "a", "b", or "c"
- 匹配除字符集合或者字符列表之外的任意一个字符,例如[^abc]将不会匹配 "a", "b", 或 "c"
- -
- (minus sign) character range used within character class, e.g. [a-z] matches a character in the range "a" through "z"
- (减号)用在字符列表中表示字符范围,例如[a-z]匹配从"a" 到 "z"的字符
- |
- (vertical bar) logical or, e.g. (foo|bar) matches "foo" or "bar"
- (垂直符号)逻辑或,例如(foo|bar) 匹配 "foo" 或 "bar"
- *
- (asterisk) match the preceding character or group zero or more times, e.g. foo* matches "fo", "foo", "fooo", etc, but not "f"
- (星号)匹配它前面的字符或组零次或多次,例如 foo* 匹配 "fo", "foo", "fooo", 等等, 但是不会匹配 "f"
- +
- (plus-sign) match the preceding character or group one or more times, e.g. foo+ matches "foo", "fooo", etc, but not "f" or "fo"
- (加号)匹配它前面的字符或组一次或多次,例如 foo+ 匹配 "foo", "fooo", 等等, 但是不会匹配 "f" 或 "fo"
- ?
- (question mark) match the preceding character or group zero or once only, e.g. foo? only matches "fo" and "foo"
- (问号)匹配它前面的字符或组零次或一次,例如 foo? 只匹配 "fo" 和 "foo"
- \0 - \9
- used in "Replace with" field to represent text matched with parenthesis (\0 = whole match, \1 - \9 = submatches), no back-references
- 在“替换为”框里表示括号匹配的文本(\0 = 全匹配, \1 - \9 = 子匹配),不支持回退引用
- &
- When used in the "Replace with" field, the entire match is replaced. To replace with an actual ampersand, you must escape it \&
- 在“替换为”框里使用时,会匹配整个表达式。要替换为 "&" 符号,必须转义,使用 \&
Operators and Syntax Not Supported in EditPlus 在EditPlus中不支持的操作符和语法
Some common regular expression syntax/operators not available in EditPlus:
- foo{num}
- match foo exactly num times
- foo{min, max}
- match foo at least min and at most max times, both optional
- \a
- 0x07, BEL
- \f
- 0x0C, formfeed
- \r
- 0x0D, carriage return, see \n
- \e
- 0x1B, ESC
- \xfoo
- 0xfoo, hexadecimal character reference
- \cfoo
- control-foo
- \s
- whitespace character, use [ \t\n]
- \S
- non-whitespace character, use [^ \t\n]
- \d
- decimal digit, use [0-9]
- \D
- not a decimal digit, use [^0-9]
- \w
- word character, letter, for English use [A-z]
- \W
- non-word character, non-letter, for English use [^A-z]
- [[:alpha:]], [[:lower:]], [[:upper:]], [[:alnum:]], [[:digit:]], [[:xdigit:]], [[:punct:]], [[:graph:]], [[:print:]], [[:blank:]], [[:space:]]
- predefined character classes (POSIX)
- \b
- word boundary (assertion)
- \B
- not a word boundary (assertion)
- \A
- subject start (assertion), use ^
- \Z
- subject end (assertion), use [\n$]
- \z
- subject end (assertion), use $
- assertions other than ^ and $
- parts of patterns that are not added to matches:
- (?=foo)
- positive assertion
- (?!foo)
- negative assertion
- (?<=foo), (?<!foo)
- look-behind assertion
- (?>=foo), (?>!foo)
- look-ahead assertion, once-only sub-pattern
- (?(foo)true), (?(foo)true|false)
- conditional sub-pattern, foo being either the number of a sub-pattern or an assertion
- (?:foo)
- grouping, non-referencable
- (?ifoo), (?mfoo), (?sfoo), (?xfoo)
- inline modifiers
- (?R)
- recursive pattern
- (?#foo)
- comment
Workaround
A user tool, Full RegEx Supported Replace and More has been developed that adds full regex support to EditPlus.
转载于:https://www.cnblogs.com/ohio/p/3775949.html
Editplus的正则表达式相关推荐
- EditPlus正则表达式
EditPlus支持的正则表达式 EditPlus对正则表达式的支持有限,不支持 重复频度 的定义,如:{3}.{3,}.{3,6}... 下面列出EditPlus查找或替换时支持的元字符: 表达 ...
- 巧用EditPlus包含VS2010网站项目资源
巧用EditPlus包含VS2010网站项目资源 巧用EditPlus包含VS2010网站项目资源 从Eclipse转来开发VS2010的网站时,发现管理项目文件都要复杂很多. 之前可以自动发布的图片 ...
- 在editplus中 删除空白行、匹配删除行
Editplus中 一.替换空白行,表达式 : ^[ \t]*\n (1)选择"行首",则查找内容组合框中出现字符"^",表示待查找的字符串必须出现在文本中一行 ...
- editplus使用技巧集萃(二)
[15]工具集成-- 让Editplus调试PHP程序 1:打开Editplus,选择"工具->;配置用户工具..."菜单. 2:在弹出的窗口中选择"添加工具-&g ...
- 正则去掉oracle空行,正则表达式删除多余空行
从网上收集的文章大多有大量多余的空行,占据了许多篇幅,如果需要打印就非常浪费纸张.想要删除这些空行,可是这些空行要么不包含任何字符,要么包含了许多空格.制表符(Tab).如果文章比较长,那么手工删除空 ...
- 滚轮JAVA_java滚轮
Android滚轮控件,基于ListView实现,可以自定义样式. Android滚轮控件,基于ListView实现,可以自定义样式. 原博文链接:http://www.apkbus.com/blog ...
- php字符串去掉空,php去掉字符串空
PHP对表单提交特殊字符的过滤和处理 函数名 释义 介绍 htmlspecialchars 将与.单双引号.大于和小于号化成HTML格式 &转成& "转成" ' 转 ...
- Editplus查找替换的正则表达式应用说明
表达式 说明 \t 制表符. \n 换行. . 匹配任意字符. | 匹配表达式左边和右边的字符. 例如, "ab|bc" ...
- EditPlus正则表达式替换字符串详解
EditPlus正则表达式替换字符串详解 发布时间:April 8, 2007 分类:Regular <PHP 实现多服务器共享 SESSION 数据> <利用javascript在 ...
最新文章
- excel正在等待某个应用程序以完成对象链接与嵌入操作_看完这篇操作系统,和面试官扯皮就没问题了
- 用git发patch
- BZOJ 4103 [Thusc 2015]异或运算 (可持久化01Trie+二分)
- dubbo-go v1.5.6来喽!
- java判断读到末尾_Flink实战:自定义KafkaDeserializationSchema(Java/Scala)
- 怎么学习正则表达式?(正则的使用心得)
- python数据处理框架_python 最快 web 框架 Sanci 快速入门
- 马化腾:5G技术可以影响甚至重构整个互联网服务形态
- JavaScript学习(八十五)—数据类型的转换
- tensorflow错误:InvalidArgumentError (see above for traceback): Cannot assign a device for operation
- luogu P2680 运输计划 (二分答案+树上差分)
- 使用python连接eNSP中交换机并添加配置
- 解决谷歌chrome浏览器双击没反应,不能启动(亲测好用)
- 多项式曲线拟合 c语言6,多项式曲线拟合
- linux uwsgi 非root,只能以root身份运行uwsgi
- 【Akka】Akka 学习 akka 两本书的读后感
- NLP训练营学习记录(一)
- 计算机英语versatile意思,英语单词versatile是什么意思,英文单词查询versatile,在线单词versatile翻译...
- 《数学之美》一些知识
- 基于 OSGi的企业级开发框架实践——开发框架的创建