Previous Topic: Regular ExpressionsNext Topic: Copy Items to the Clipboard as Text


Supported Metacharacters

The following characters are accessible from the Value field of the Define Filter dialog when the condition is set to regexp match.

^

Matches the beginning of a line, for example, ^Where is matches "Where is my computer" but not "Where on earth is my computer."

$

Matches the end of a line, for example, procedure$ matches the end of the string "Use that procedure" but not "Use those procedures."

Example: [0-2][0-9]$ matches strings ending with numerals in the range 00-29.

.

Matches any single character.

Example: a.b matches any three-character string which begins with "a" and ends with "b."

[c1-c2]

Matches any character in the range (specified by using a hyphen).

Example 1: [0-9] matches any digit, whereas [a-zA-Z] matches any lowercase or uppercase letter.
Example 2: [b-n]ut matches "but," "cut," "hut," "jut," and "nut," but not "put."

[^c1-c2]

Matches any character except those in the range, that is, it matches the complement range.

Example: [^0-9] matches any character except the digits.

*

Matches zero or more occurrences of the character immediately before the *.

Example 1: t* matches any sequence that is a back-to-back series of 0 or more occurrences each matched by t, that is, (empty), "t," "tt," "ttt," and so on.
Example 2: ab*c matches "ac," "abc," "abbc," "abbbbc," and so on.
Example 3: .* matches any number of any characters.

+

Matches one or more occurrences of the character or regular expression immediately before the +.

Example 1: a+ matches, for example, "a, "aa, "aaa."
Example 2: (is)+ matches "is," "crisis," and so on.

?

Matches zero or one occurrence of the character or regular expression immediately before the ?.

Example 1: wi?n matches the strings "wn" or "win."
Example 2: w.?n matches, for example, the strings "wn," "win," "won," "w7n."

[c1c2]

Matches any of the characters between the brackets.

Example: b[aiu]t matches "bat," "bit" or "but," but not "bet."

[^c1c2]

Matches the complemented character set of the characters between the brackets.

Example: b[^012345678]t matches "b9t," "bat," "bit," "bet," "but" and so on. See also [^c1-c2].

|

Matches either condition (logical OR).

Example: Fixed disk drive C|D: matches "Fixed disk drive C:" and it matches "Fixed disk drive D:" but it does not match "Fixed disk drive E:".

More information:

Create a Filter