Regular Expression in ultraedit UE

Source: Internet
Author: User
Tags ultraedit

UE is always used, but it is used in notepad. It's easy to use. Search and replacement are always used recently, and they are usually used on the Internet. Today I read the Help File of UE. The original description is very detailed. Send it and record it.

Ultraedit allows you to use regular expressions in most search and replacement functions listed under the search menu.

 

Regular Expressions allow multiple combined search and replacement functions in one operation.

 

There are two syntax sets available here. The first table below shows the original ultraedit syntax for early ultraedit. The second table displays the optional "Unix" regular expressions. This can be enabled from the configuration section.

 

Regular Expression (ultraedit syntax ):

 

Symbol Function
% 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 end of the line 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.
++ Matches the previous character/expression zero or multiple times. Duplicate line breaks are not matched.
^ B Match a paging character.
^ P Match a line break (CR/LF) (Section) (DOS file)
^ R Match a line break (CR only) (Section) (MAC file)
^ N Match A linefeed (lf only) (Section) (UNIX file)
^ T Match 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 to the expression and use them 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.

 

Note-^ the character "^" here is not the control key + value.

 

For example:

M? N matches "man", "men", and "min", but does not match "moon ".

 

T * t matches "Tea t" in "test", "tonight", and "tea time", but does not match "tea"

Time (there is a line break between "tea" and "time ).

 

Te + st matches "test", "teest", and "teeeest", but does not match "TST ".

 

[Aeiou] matches each vowel in lower case

[,.?] Match the text ",", ".", or "?".

[0-9a-z] matches any number or lowercase letter

[~ 0-9] match any character except a number (~ Does not match the subsequent content)

 

You can search for expressions A or B as follows:

 

"^ {John ^} ^ {Tom ^}

 

This will search for John or Tom. There should be no other content between two expressions.

 

You can combine a, B, c, or D in the same search as below:

 

"^ {John ^} ^ {Tom ^} ^ {Smith ^} ^ {Jones ^ }"

 

This will search for John or Tom that follows Smith or Jones.

 

The following table shows the regular expression syntax of the "Unix" style.

 

Regular Expressions (UNIX syntax ):

 

Symbol Function
/ Indicates that the next character has a special meaning. "N" indicates that the character "N" is matched, and "/N" matches a line break. Take the following example (/d,/F,/N, etc ).
^ Match/stop the first line.
$ Match/stop at the end of the line.
* Match the previous character 0 or multiple times.
+ Match the previous character once or multiple times. Duplicate line breaks are not matched.
. Match any single character except line breaks. Duplicate line breaks are not matched.
(Expression) Add parentheses or tags to the expression and use them 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.

[Xyz] Character Set that matches any character in parentheses ..
[^ XYZ] Exclude character sets. Match any character that is not in parentheses.
/D Match a numeric character. It is equivalent to [0-9].
/D Match a non-numeric character, equivalent to [^ 0-9].
/F Match a form feed.
/N Match A linefeed.
/R Match a carriage return.
/S Matches any characters that do not contain spaces or tabs, but does not match line breaks.
/S Matches any non-blank area (show characters) characters, but does not match line breaks.
/T Match a tab.
/V Match a vertical tab.
/W Match any words that contain underscores.
/W Match any non-word characters.
/P Match Cr/LF (equivalent to/R/N) to match the DOS line terminator.

 

Note-^ the character "^" here is not the control key + value.

 

For example:

M. N matches "man", "men", and "min", but does not match "moon ".

 

Te + st matches "test", "teest", and "teeeest", but does not match "TST ".

 

Te * st matches "test", "teest", "teeeest", and "TST ".

 

[Aeiou] matches each vowel in lower case

[,.?] Match the text ",", ".", or "?".

[0-9a-z] matches any number or lowercase letter

[^ 0-9] matches any character except a number (~ Does not match the subsequent content)

 

You can search for the expression A or B as follows:

 

"(John | Tom )"

 

This will search for John or Tom. There should be no other content between two expressions.

 

You can combine a, B, c, or D in the same search as below:

 

"(John | Tom) (Smith | Jones )"

 

This will search for Smith or Jones and John or Tom following him.

 

If the regular expression is not selected in search/replace, the following special characters in the replace object are also valid:

 

Symbol Function
^ Match the character "^"
^ S Indicates the selected (highlighted) text in the activity file window.
^ C The content of the clipboard table.
^ B Match a paging character.
^ P Match a line break (CR/LF) (Section) (DOS file)
^ R Match a line break (CR only) (Section) (MAC file)
^ N Match A linefeed (lf only) (Section) (UNIX file)
^ T Match a tab

 

Note-^ the character "^" here is not the control key + value.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.