格式跟UNIX/Perl略有不同吧,以下是UE帮助里面的
Symbol Function
% Matches the start of line - Indicates the search string must be at the beginning of a line but does not include any line terminator characters in the resulting string selected.
(用%匹配一行的开始)
$ Matches the end of line - Indicates the search string must be at the end of line but does not include any line terminator characters in the resulting string selected.
(用$匹配一行的结束)
? Matches any single character except newline
(用?匹配除了新行外的任意单一字符)
* Matches any number of occurrences of any character except newline
(*匹配除新行外的任意数目的任意字符)
+ Matches one or more of the preceding character/expression. At least one occurrence of the character must be found.
(+匹配除新行外的至少1个的指定字符)
++ Matches the preceding character/expression zero or more times.
(++匹配指定字符的0或多次,就是除1次外的)
^b Matches a page break
(用^b匹配一个分页符)
^p Matches a newline (CR/LF) (paragraph) (DOS Files)
(用^p匹配dos格式下的一个新行符)
^r Matches a newline (CR Only) (paragraph) (MAC Files)
(用^r匹配MAC 格式下的一个新行符)
^n Matches a newline (LF Only) (paragraph) (UNIX Files)
(用^n匹配UNIX格式下的一个新行符)
^t Matches a tab character
(用^t匹配制表符)
[ ] Matches any single character, or range in the brackets
(匹配中括号内的任一字符)
^{A^}^{B^} Matches expression A OR B
(匹配表达式A或表达式B)
^ Overrides the following regular expression character
(忽略后面的正则表达式)
^(…^) Brackets or tags an expression to use in the replace command. A regular expression may have up to 9 tagged expressions, numbered according to their order in the regular expression.The corresponding replacement expression is ^x, for x in the range 1-9. Example: If ^(h*o^) ^(f*s^) matches “hello folks”, ^2 ^1 would replace it with “folks hello”.
^(A^) 将表达式A匹配到的内容赋予^1,在替换过程中可以使用^1进行动态替换。
如果有更多的如:^(A^)^(B^)^(C^)^(D^),若匹配成功,那么替换内容中可以分别使用^1^2^3^4提取ABCD所匹配到的内容。