Regular Expressions (Legacy

)

Page 1 of 3

Regular Expressions (Legacy)
UltraEdit allows for Regular Expressions in many of its search and replace functions listed under the Search Menu.

 

 
Regular expressions allow more complex search and replace functions to be performed in a single operation.

 
There are two possible sets of legacy syntax that may be used. The first table below shows the original UltraEdit syntax used in earlier versions of UltraEdit.  The second table shows the optional "Unix" style regular expressions.  This may be enabled from the Configuration Section.

 
Regular Expressions (UltraEdit Syntax):

 
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. Does not match repeated newlines. Matches the preceding character/expression zero or more times. Does not match repeated newlines. Matches a page break. Matches a newline (CR/LF) (paragraph) (DOS Files) Matches a newline (CR Only) (paragraph) (MAC Files) Matches a newline (LF Only) (paragraph) (UNIX Files) Matches a tab character A character set. Matches any characters between brackets. A negative character set. Matches any characters NOT between brackets including newline characters. 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".

$

? * +

++ ^b ^p ^r ^n ^t [xyz] [~xyz]

^{A^}^{B^} Matches expression A OR B ^ ^(...^)  

 
Note - ^ refers to the character '^' NOT Control Key + value.

 
Examples: m?n matches "man", "men", "min" but not "moon".

 
t*t matches "test", "tonight" and "tea time" (the "tea t" portion) but not "tea time" (newline between "tea " and "time").

 
Te+st matches "test", "teest", "teeeest" etc. but does not match "tst".

 
[aeiou] matches every lowercase vowel [,.?] matches a literal ",", "." or "?". [0-9a-z] matches any digit, or lowercase letter [~0-9] matches any character except a digit (~ means NOT the following)

 
You may search for an expression A or B as follows:

 
"^{John^}^{Tom^}"

 
This will search for an occurrence of John or Tom. There should be nothing between the two expressions.

 
You may combine A or B and C or D in the same search as follows:

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

 
This will search for John or Tom followed by Smith or Jones.

 

mk:@MSITStore:C:\Program%20Files\IDM%20Computer%20Solutions\UltraEdit\Uedit... 10/16/2013

[0-9a-z] matches any digit.   The corresponding replacement expression is \x.   Te*st matches "test". Matches a tab character. "min" but not "moon". for x in the range 1-9. ".n matches "man". Equivalent to [^0-9]. Matches any characters between brackets. Matches any word character including underscore.*s) matches "hello folks".Regular Expressions (Legacy) Page 2 of 3   The table below shows the syntax for the "Unix" style regular expressions.e. Does not match repeated newlines.   If Regular Expressions is not selected (i. Matches CR/LF (same as \r\n) to match a DOS line terminator. "teeeest" etc. Matches a carriage return character. A character set.   [aeiou] matches every lowercase vowel [. Matches a form-feed character.^ refers to the character '^' NOT Control Key + value.". Matches the preceding character zero or more times. BUT NOT "tst". "teest". Matches a nondigit character.. \n etc).  (expression) [xyz] [^xyz] \d \D \f \n \r \s \S \t \v \w \W \p   Note . There should be nothing between the two expressions. or lowercase letter [^0-9] matches any character except a digit (^ means NOT the following)   You may search for an expression A or B as follows:   "(John|Tom)"   This will search for an occurrence of John or Tom. Does not match repeated newlines. Matches/anchors the beginning of line. Matches any single character except a newline character. form-feed. Equivalent to [0-9].   Examples: m. "teest". Matches any non-whitespace character but not newline. Matches any nonword character." or "?". Matches any whitespace including space. Matches the preceding character one or more times. A regular expression may have up to 9 tagged expressions. "teeeest" etc.  Example: If (h. AND "tst". Matches/anchors the end of line. "\n" matches a linefeed or newline character. "men".. Brackets or tags an expression to use in the replace command.?] matches a literal ". ^ $ * + .*o) (f.   Te+st matches "test". \f. Matches a linefeed character. numbered according to their order in the regular expression. Matches any characters NOT between brackets including newline characters. no usage of Regular Expressions is active) for a find/replace the following special characters are also valid in the Find and Replace fields:   Symbol Function mk:@MSITStore:C:\Program%20Files\IDM%20Computer%20Solutions\UltraEdit\Uedit. Matches a vertical tab character. A negative character set. 10/16/2013 .   You may combine A or B and C or D in the same search as follows:   "(John|Tom) (Smith|Jones)"     This will search for John or Tom followed by Smith or Jones. See examples below (\d. \2 \1  would replace it with "folks hello". etc but not newline. "n" on it's own matches the character "n". Matches a digit character. tab..   Regular Expressions (Unix Syntax):   Symbol \ Function Indicates the next character has a special meaning.

mk:@MSITStore:C:\Program%20Files\IDM%20Computer%20Solutions\UltraEdit\Uedit.^ refers to the character '^' NOT Control Key + value. Matches a page break Matches a newline (CR/LF) (paragraph) (DOS Files) Matches a newline (CR Only) (paragraph) (MAC Files) Matches a newline (LF Only) (paragraph) (UNIX Files) Matches a tab character   Note ..      For information regarding Perl Compatible Regular Expressions please click here.Regular Expressions (Legacy) Page 3 of 3 Symbol ^^ ^s ^c ^b ^p ^r ^n ^t Function Matches a "^" character Is substituted with the selected (highlighted) text of the active file window.. Is substituted with the contents of the clipboard. 10/16/2013 .

Sign up to vote on this title
UsefulNot useful