I.source
How to use regular expressions in Notepad++
http://sourceforge.net/apps/mediawiki/notepad-plus/index.php%3Ftitle%3DRegular_Expressions
Source of this information is the Scintilla edit component help
http://www.scintilla.org/SciTERegEx.html
Notepad++ implements reg-exes in a subset of Posix mode only
http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Unsupported_Regex_Operators
operator was introduced in Scintilla v2.25 (not yet documented)
http://www.scintilla.org/ScintillaDoc.html
0000
II.regular brother plugins
Ctrl+R or in the TextFX -> TextFX Quick -> Find/Replace
III.regular
-
.
Matches any character.
-
\x
This allows you to use a character x that would otherwise have a special meaning. For example, \[ would be interpreted as [ and not as the start of a haracter set.
-
[...]
This indicates a set of characters, for example, [abc] means any of the characters a, b or c. You can also use ranges, for example [a-z] for any lower case character.
-
[^...]
The complement of the characters in the set. For example, [^A-Za-z] means any character except an alphabetic character. Multiplying operators
-
+
This matches 1 or more instances of the previous character, as many as it can. For example, Sa+m matches Sam , Saam , Saaam and so on. [aeiou]+ matches consecutive strings of vowels.
-
*
This matches 0 or more instances of the previous character, as many as it can. For example, Sa*m matches Sm , Sam , Saam , Saaam and so on.
-
?
Zero or one of the last character. Thus Sa?m matches Sm and Sam, but not Saam.左边的最后一个字符匹配0次或1次
-
*?
Zero or more of the previous group, but as few as possible. Thus, .*o won't ever match because .* gobbles everything up to the end of line. .*?o matches everything up to and incuding the next 'o'.
-
+?
One or more of the previous group, but as few as possible. Anchors
-
^
This matches the start of a line (except when used inside a set, see above).
-
$
This matches the end of a line.
-
\<
This matches the start of a word using Scintilla's definitions of words.
-
\>
This matches the end of a word using Scintilla's definition of words.
-
(...)
Parentheses mark the start of a region for tagging a match; so what's inside ( ) you can use in "replace with" using \1, \2 etc. Important: Unlike many other regular-expression engines, parentheses do not create subexpressions.
IV.Case
-
匹配第一次出现
“abcdefabcdef”匹配到第一次出现的字符--->"^.+?f":=abcdef
-
去掉代码行前的数字
^[0-9]+?
^[0-9].+?
^[0-9] ?
-
查找中文字符(utf8)
[^\x00-\x7F]