HP-UX Reference (11i v1 05/09) - 3 Library Functions N-Z (vol 7)
r
re_comp(3X) re_comp(3X)
(TO BE OBSOLETED)
2.5 A RE enclosed between the character sequences \( and \) is a RE that matches whatever the
unadorned RE matches.
2.6 The expression \n matches the same string of characters as was matched by an expression
enclosed between \( and \) earlier in the same RE. Here n is a digit; the sub-expression
specified is that beginning with the n -th occurrence of \( counting from the left. For example,
the expression ˆ\(.*\)\1$ matches a line consisting of two repeated appearances of the same
string.
Finally, an entire RE may be constrained to match only an initial segment or final segment of a line (or
both).
3.1 A circumflex (ˆ) at the beginning of an entire RE constrains that RE to match an initial segment
of a line.
3.2 A dollar symbol ($) at the end of an entire RE constrains that RE to match a final segment of a
line. The construction ˆentire RE$ constrains the entire RE to match the entire line.
The null RE (that is, //) is equivalent to the last RE encountered.
The behaviour of
re_comp() and re_exec() in locales other than the POSIX locale is unspecified.
RETURN VALUE
The re_comp() function returns a null pointer when the string pointed to by the string argument is suc-
cessfully converted. Otherwise, a pointer to an unspecified error message string is returned.
Upon successful completion,
re_exec() returns 1 if string matches the last compiled regular expression.
Otherwise, re_exec() returns 0 if string fails to match the last compiled regular expression, and −1if
the compiled regular expression is invalid (indicating an internal error).
ERRORS
No errors are defined.
APPLICATION USAGE
For portability to implementations conforming to earlier versions of this document,
regcomp() and
regexec() are preferred to these functions.
WARNINGS
Obsolescent Interfaces
re_comp() and re_exec() are to be obsoleted at a future date.
SEE ALSO
regcomp(3C), <re_comp.h>.
CHANGE HISTORY
First released in Issue 4, Version 2.
Section 3−−784 Hewlett-Packard Company − 2 − HP-UX 11i Version 1: September 2005