.TH regerror() "" "" "Regular-Expression Function (libc)"
.PC "Return an error message from a regular-expression function"
.B "#include <regexp.h>
\fBvoid regerror(\fImessage\^\fB)\fR
\fBchar *\fImessage\^\fB;\fR
.PP
Function
.B regerror()
is the function that is called by default when an error is detected
in any of the regular-expression functions
.BR regcomp() ,
.BR regexec() ,
or
.BR regsub() .
It prints
.I message
onto the standard-error device, plus some text to indicate whence the
message originates; then calls
.B exit()
to abort the program in which the error occurred.
.PP
You are not obliged to use
.B regerror()
to report an error with a regular-expression function.
You can substitute another function of your choosing, should you prefer.
.SH "See Also"
.Xr "libc," libc
.Xr "regexp.h" regexp.h
