日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Editplus的正则表达式

發布時間:2024/4/15 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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,也通??s寫為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的正则表达式的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。