Regular Expression (ultraedit syntax ):
% Match the first line-indicates that the search string must start with the line, but does not include the row termination characters in any selected result characters.
$ Match the end of a line-indicates that the search string must be at the end of the line, but does not include the row termination character in any selected result character.
? Match any character except the line break.
* Match any number of characters except line breaks.
+ Match one or more previous characters/expressions. At least one character must be found. Duplicate line breaks are not matched.
+ 0 or multiple times match the previous character/expression. Duplicate line breaks are not matched.
^ B matches a paging character.
^ P matches a linefeed (CR/LF) (Section) (DOS file)
^ R matches a line break (CR only) (Section) (MAC file)
^ N matches a linefeed (lf only) (Section) (UNIX file)
^ T matches a tab
[] Match a single character or range in any parentheses
^ {A ^} ^ {B ^} matching expression A or B
^ Ignore the subsequent regular expression characters
^ (* ^) Add parentheses or tags in the expression to use in the replacement command. There can be 9 expression tags in a regular expression, and numbers are determined based on their order in the regular expression.
The corresponding replacement expression is ^ X, and the range of X is 1-9. For example, if ^ (H * o ^) ^ (F * s ^) matches "Hello folks", ^ 2 ^ 1 indicates that it will be replaced with "Folks hello.
Regular Expression Search Skills (ultraedit syntax ):
Delete empty rows: replace % [^ t] ++ ^ P with empty strings.
Remove trailing space: Replace [^ t] + $ with an empty string
Space at the beginning of the row to be deleted: % [^ t] + is replaced with an empty string
Each line starts with four fixed spaces: replace % [^ t] ++ ^ ([~ ^ T ^ p] ^) is "^ 1"
Each segment starts with a fixed 4-digit space: replace % [^ t] + ""
(If a line starts with a space, it is regarded as the starting line of a segment)
Merge a segment into one row: Replace [^ t] ++ ^ P ^ ([~ ^ T ^ p] ^) is ^ 1
(Note: here we assume that the text is a line break in DOS mode-Cr/LF)
Remove HTML Tag: replace ^ {<*> ^} ^ {<* ^ p *> ^} with an empty string.
Delete all <A>: replace <[] ++ A * [] ++ href [] ++ = *> with an empty string.
Delete the first two columns of characters specified in the text: replace % ?? Empty string
Insert 2 blank characters after the first column: replace % ^ (???? ^) ^ (? ^) Is "^ 1 ^ 2"
Search for all numbers: [0-9] + [.] ++ [0-9] +
Find all words: [A-Z] +
Find all urls: http: // [a-z0-9 ^ ~ '_./^-^? = &] +