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

OSS Library Calls (n - r) re_comp(3)
|
5. ||
A regular expression string enclosed with \( and \) is a regular expression string that |
matches whatever the enclosed regular expression string matches. |
|
6. ||
The expression \n matches the same character string matched by an expression enclosed |
within \( and \) earlier in the same regular expression string. In particular, the earlier |
string is that beginning with the nth occurrence of \( counting from the left. |
Finally, the circumex (ˆ) and dollar sign ($) characters can be used to limit a regular expression |
string to matching the initial segment, the nal segment of the line, or both. |
|
1. ||
If a regular expression string has a circumex (ˆ) as its rst character, the regular expres- |
sion string must match the initial segment of a line. |
|
2. ||
If a regular expression string has a dollar sign ($) as its last character, the regular expres- |
sion string must match the nal segment of a line. The construct ˆregexp$ means that the |
regular expression string regexp must match the entire line. |
A null regular expression string (that is, //) is equivalent to the last regular expression string |
encountered. |
NOTES |
This function can be called by a native process only. |
The behavior of this function in locales other than POSIX is undened. |
RETURN VALUES
|
When the re_comp() function successfully converts the string pointed to by the re_string |
parameter, it returns a null pointer. Otherwise, it returns a pointer to an error message string. |
ERRORS |
When the re_comp() function does not successfully compile the regular expression string |
pointed to by the re_string parameter, it returns a pointer to one of the following error messages: |
no regular expression compiled
|
no previous regular expression compiled
|
backreference to non-existing subexpression
|
bad range in bracket expression []
|
[] imbalance
|
* not preceded by valid RE
|
\{\} not preceded by valid RE
|
bad value in \{\}
|
imbalanced \(\) - unmatched \)
|
imbalanced \(\) - unmatched \(
|
trailing \ in pattern |
527187-007 Hewlett-Packard Company 583