Regular expression syntax supported by PatternPro

.

matches any character except the newline (see rxRegex.Newline)

^

Matches the beginning of a string (optionally), or the beginning of a line.

$

Matches the end of a string (optionally) or the end of a line.

"..."

Characters within double quotes are taken literally. Special characters including double quotes may be included using escape sequences.

[...]

Matches any character placed within the brackets. Ranges of characters may be included by separating them with a "-", for example [0-9] matches any single digit, and [0-9a-fA-F] matches a hexadecimal digit. When a "^" is the first character in the class, the class is negated, that is, any character except those in the set will match. When either the "]" or a "-" is the first character, it is taken literally and not as a control character. Special characters may be included using escape sequences.

\

Used to indicate an escape sequence. " \n" is a newline, "\r" is a carriage return, while "\*" is a literal asterisk. Use "\\" to match the "\" character. Using "\" with any character other than n,r and t insures that character is evaluated literally, even if it is a control character such as "["

*

Indicates the expression must match zero or more times

+

Indicates the expression must match one or more times

?

Indicates the expression is optional

|

Indicates the expression or the following expression may match - (an 'or' operator)

/

Indicates the following expression must also match but is not counted in the length of the overall match.

{...}

Indicates the number of times an expression must match. {1},{1,},{2,5}{,3} are valid.

(...)

Groups expressions into a logical subexpression. For example: (0[xX])|(&[hH])[0-9A-Fa-f]+

meta characters

Metacharacters represent a set of pattern characters that may be used in regular expressions to include another character or string of characters. Metacharacters are used whenever it is syntactically impossible to include a character in a regular expression without breaking the rules of syntax. Metacharacters are valid in character sets, literals, and double quoted literals. Some examples of meta characters are the inclusion of tabs, carriage returns, linefeeds, and especially the double quote (") character. PatternPro accepts the following metacharacter sequences - more may be added. Take care when attempting to include double quotes in your patterns. VB syntax has special requirements for including them in strings.

metacharacter sequence

interpreted value

\r

a carriage return character - vbCr

\n

a linefeed character - vbLf

\t

a tab character - vbTab

\\

a backslash character

\l

substitutes the current Newline value assigned to the rxRegex object. (see rxRegex below)

backslash followed by any other character

represents the second character literally, for example "\$" = "$". Can be used to include control characters into an expression.

\nnn

inclusion of an octal numeric value

\xnn or \Xnn

inclusion of a hexadecimal numeric value

\innnnn or \Innnnnn

inclusion of an integer value

other

more to be included in next release.

Copyright 1999, 2000 BlackBox Software & Consulting