Regular Expressions

The regular expressions accepted by the "Find/Replace" dialogs must conform to the following syntax.

Characters

Syntax Signification
x The character x - with the exception of special characters * ? + - | () [ ]
\x The character x

Atoms

Syntax Signification
a the character a
[abc] the class formed by the characters a, b or c
[a-z] all the characters from a to z
[a-zA-Z] all the characters from a to z, or from A to Z
[^a] any character except a
[^a-z] any character except those between a and z (inclusive).
. any character except the line break or carriage return (equivalent to [^\n\r].

Note: using parentheses or the +, ?, *, or | operators is not allowed within a character class specification.

Cardinality

Syntax Signification
X* zero or more occurence(s) of the letter X
X+ one or more occurence(s) of the letter X
X? at least one occurence(s) of the letter X

Operators

Syntax Signification
XY X followed by Y
X|Y X or Y

Precedence rules The operators below are listed in descending order of priority :

Using parentheses modifes these priorities.

Examples

Example Corresponding strings
foo the string "foo"
a|bc a or b, followed by c (in other words "ac" or "bc")
a|(bc) the string "a" or the string "bc"
ab+ the strings starting with a followed by one or more b's
(ab)+ the strings "ab", "abab", "ababab", etc.
[a-z]+ all words
[a\-z]+ all successions of characters a, z, -
dim [a-z][a-z0-9_]* as +(new +)?timer all declarations of an object of type Timer.
[0-9]+( +)|[\t,;][tTfF]( +)|[\t,;][a-zA-Z]+\n a numeric field, a boolean field, a non-empty text field then a line break, separated by spaces or a delimiter
[0-9]+ a positive integer
[0-9][0-9]?/[0-9][0-9]?/(19)|(20)[0-9][0-9] a date
[\+\-]?[0-9]+(\.[0-9]*)?([eE][\+\-]?[0-9]+)? a number in scientific notation
[0-9a-z_]+(\.|-[0-9a-z_]+)*@[0-9a-z_]+(\.|-[0-9a-z_]+)+ an email address