Open System Services Library Calls Reference Manual (G06.28+, H06.05+)

re_comp(3) OSS Library Calls Reference Manual
|
||
Any character used to delimit a regular expression string is special for that regu- |
lar expression string. |
|
3. ||
A period (.) is a one-character regular expression string that matches any one single char- |
acter except newline. |
|
4. ||
A set of square brackets containing a non-empty string of characters is a one-character |
regular expression string that matches any one character found within the brackets. |
When the rst character of the bracketed string is a "ˆ" (caret or circumex), the one- |
character regular expression string matches any one character except the new-line and |
those characters following the "ˆ" in the bracketed string. |
Within the bracketed string, a minus sign (-) can be used to specify a range of consecu- |
tive ASCII characters. For example, [0-9] is the same as [0123456789]. If, however, the |
minus sign is the rst character (following any initial "ˆ") or the last character within the |
bracketed string, it loses this special meaning. |
When a right square bracket is the rst character (following any initial "ˆ") within a |
bracketed string, it has no special meaning and simply matches itself. |
When the ",", "*", "[", or "\" characters appear within a bracketed string, they have no |
special meaning and simply match themselves. |
To construct more complex regular expression strings from the one-character regular expression |
strings, the following rules are used: |
|
1. ||
A one-character regular expression string matches is a regular expression string that |
matches whatever the one-character regular expression string matches. |
|
2. ||
A one-character regular expression string followed by an asterisk (*) is a regular expres- |
sion string that matches 0 (zero) or more occurrences of the one-character regular expres- |
sion string. The longest leftmost string that matches is chosen. |
|
3. ||
A one-character regular expression string followed by \{m\}, \{m,\},or\{m,n\} (where m |
and n are non-negative integers less than 256) is a regular expression string that matches |
a range of occurrences of the one-character regular expression string. \{m\} matches |
exactly m occurrences; \{m,\} matches at least m occurrences; and \{m,n\} matches |
between m and n occurrences, inclusive. |
|
4. ||
The concatenation of two or more regular expression strings matches a concatenation of |
the strings matched by the individual regular expression strings. |
582 Hewlett-Packard Company 527187-007