You are on page 1of 3

Regular expressions with find and replace http://www.ultraedit.com/support/tutorials_power_tips/ultraedit/regula...

Search UltraEdit.com

Home Products Products Downloads Register/Buy Upgrade Support Company Resources


Home » Support » Tutorials/Power Tips » UltraEdit » Regular expressions

1 de 3 26/02/2010 9:59
Regular expressions with find and replace http://www.ultraedit.com/support/tutorials_power_tips/ultraedit/regula...

Regular expressions

Regular Expressions are essentially patterns rather than specific strings that are used with Find/Replace
Get your solution today!
operations. There are many ways that regular expressions may be used to streamline operations and enhance
efficiency. We have listed below a reference key for both UltraEdit-style and UNIX-style regular expressions as

well as some examples to demonstrate how regular expressions may be used in UltraEdit.

Si mple String Matchi ng


Character Sets
Add UltraCompare to your
OR Expressions purchase/upgrade of UltraEdit
Deleti ng Blank Lines and complete your file
management solution.
Reformatting wi th Tagged Expressions
Get your solution now
Regula r Expre ssio ns in UltraEdit
UltraEdit UNIX
Functio n
Symbol Symbo l
% ^ Matches/anchors the beginning of line.

$ $ Matches/anchors the end of line. "We won't mince words:


UltraEdit is outstanding..."
? . Matches any single character except a newline character. Does not match repeated newlines.

* 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 Application Screenshots
character must be found. Does not match repeated newlines.

Matches the preceding character/expression zero or more times. Does not match repeated
++ *
newlines.

Indicates the next character has a special meaning. "n" on its own matches the character "n". "^n"
^ \ (UE expressions) or "\n" (UNIX expressions) matches a linefeed or newline character. See
examples below.

[] [] Matches any single character or range in the brackets.


Featuring the all new
[~xyz] [^xyz] A negative character set. Matches any characters NOT between brackets.

^b \f Matches a page break/form feed character.

^p \p Matches a newline (CR/LF) (paragraph) (DOS Files).

^r \r Matches a newline (CR Only) (paragraph) (MAC Files).

^n \n Matches a newline (LF Only) (paragraph) (UNIX Files).

^t \t Matches a tab character.

[0-9] \d Matches a digit character.

[~0-9] \D Matches a non-digit character.

[ ^t^b] \s Matches any white space including space, tab, form feed, etc., but not newline.

[~ ^t^b] \S Matches any non-white space character but not newline. UEStudio home
\v Matches a vertical tab character. UltraEdit vs. UEStudio

[a-z_] \w Matches any word character including underscore.

[~a-z_] \W Matches any non-word character.

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


Using UltraEdit's new
^ \ Overrides the following regular expression character. environments
Brackets or tags an expression to use in the replace command. A regular expression may have How to encrypt/decrypt
^(...^) (...) files
up to 9 tagged expressions, numbered according to their order in the regular expression.
Integrated scripting engine
Numerical reference to tagged expressions. Text matched with tagged expressions may be used tutorial
^1 \1
in Replace commands with this format.
Writing a macro
Note : ^ refers to the character '^' N OT Co ntrol Key + value.
More UltraEdit power tips...

UltraEdit/UNIX Regular Expression Examples Road trip, anyone?

Simple String Matching

Simple string matching is probably the most basic form of regular expressions but can allow you to quickly
exploit different patterns so that you can search for more than one string at a time rather than doing multiple
Find operations.

2 de 3 26/02/2010 9:59
Regular expressions with find and replace http://www.ultraedit.com/support/tutorials_power_tips/ultraedit/regula...

Home Products Downloads Register/Buy Upgrade Support Company

© 2010 IDM Computer Solutions, Inc


Contact | Sitemap | License Agreement | Information Policy | Site Credits | IDM Full Story

3 de 3 26/02/2010 9:59

You might also like