14.7.1. About special operators

Table 14.3 shows the characters that have special meanings in a regular expression. In some cases, their meaning depends on where they occur in the regular expression.

Table 14.3. Regular expression metacharacters

Metacharacter

Description

.

The match-any-character operator matches any single character.

*

The match-zero-or-more operator repeats the smallest preceding regular expression as many times as necessary (including zero) to match the pattern.

+

The match-one-or-more operator repeats the preceding regular expression at least once, and then as many times as necessary to match the pattern.

?

The match-zero-or-one operator repeats the preceding regular expression once or not at all.

\n

The back-reference operator refers to a literal character within the regular expression.

|

The alternation operator matches one of a choice of regular expressions, for example REG|Glob. If you place the alternation operator between any two regular expressions, the result matches the largest union of strings that it can match.

^

The match-beginning-of-line operator matches the string from the beginning of the string or after a new-line character, for example ^REG.

^

The not operator is used inside square brackets, or [], to represent a NOT action, for example R[^EG].

$

The match-end-of-line operator matches the string either at the end of the string or before a new-line character in the string, for example Comp;$.

[…]

List operators enable you to define a set of items to use as a match. The list items must be enclosed within square brackets. You cannot define an empty list, for example [Val].

Copyright © 2003, 2004 ARM Limited. All rights reserved.ARM DUI 0234B
Non-Confidential