Regular Expressions

When “Regular Expression” is checked, regular expressions are used. Regular expressions are a powerful and precise way to filter and manipulate text. You cannot use the Match Case option if you are using regular expressions.

The following table lists some special characters used in regular expressions.

Symbol
Description
Example
^
Match at the beginning of a line only.
^word
Finds lines with w in the first column.
$
Match at end of a line only.
word$
Finds lines that end with “word” (no white space follows word).
\<
Match at beginning of word only.
\<word
Finds wordless and wordly but not fullword or awordinthemiddle.
\>
Match at end of word only.
\<word
Finds keyword and sword but not wordless or awordinthemiddle.
.
A period matches any single character.
w.rd
Finds lines containing word, ward, w3rd, torward, and so on, anywhere on the line.
*
Asterisk matches zero or more occurrences of the previous character or expression.
word*
Finds word, wor, work, and so on.
+
Match one or more occurrences of the previous character or expression.
wor+d
Finds word, worrd, worrrd, and so on.
?
Match zero or one occurrences of the previous character or expression.
wor?d
Finds word and wod.
[ ]
Match any one of the characters in brackets but no others.
[AZ ]
Finds any line that contains A or Z.
[Kk][eE][Nn]
Finds any variation of case when spelling "Ken" or "KEn" or "keN".
[^ ]
Match any character except those inside the brackets.
[^AZ ]
Finds any line that does not contain the letters A or Z.
[ - ]
Match a range of characters.
[A..Z]
Finds any line containing letters A through Z on them but not lower case letters
|
A vertical bar acts as an OR to combine two alternatives into a single expression.
word | let+er
Finds word, leter, letter, lettter, and so on.
\
Make a regular-expression symbol a literal character.
\*/$
Allows searching for *. This example finds all lines ending in */

A full explanation of regular expressions is beyond the scope of this manual. UNIX users may refer to the manual page for regex using the command “man -k regex”. For a comprehensive explanation of regex expressions we refer you to the book “Mastering Regular Expressions”, published by O’Reilly and Associates (www.ora.com/catalog/regex or 1-800-889-8969).


Scientific Toolworks, Inc.
http://www.scitools.com