Open System Services Library Calls Reference Manual (G06.28+, H06.05+)
OSS Library Calls (n - r) re_exec(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 circumflex (ˆ) and dollar sign ($) characters can be used to limit a regular expression |
string to matching the initial segment, the final segment of the line, or both. |
|
1. ||
If a regular expression string has a circumflex (ˆ) as its first 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 final 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 undefined. |
RETURN VALUES
|
When the re_exec() function completes successfully and the string pointed to by the string |
parameter matches the last compiled regular expression, it returns 1. Otherwise, it returns 0 |
(zero) if the match failed, and -1 if the compiled regular expression was invalid (indicating an |
internal error). |
ERRORS |
The re_exec() function does not return error values. |
RELATED INFORMATION
|
Functions: re_comp(3), regcmp(3), regexec(3).|
STANDARDS CONFORMANCE
|
The re_exec() function is defined in the XPG4 Version 2 specification. |
527187-007 Hewlett-Packard Company 5−87