[Previous] [Contents] [Next]

regerror()

Explain a regular expression error code

Synopsis:

#include <regex.h>

size_t regerror( int err, 
                 const regex_t * reg,
                 char * buf, 
                 size_t len );

Library:

libc

Description:

The regerror() function provides a string explaining an error code returned by regcomp() or regexec(). The string is copied into buf for up to len characters. The reg parameter must be the regular expression that was provided in the failed call to regcomp() or regexec(). The err parameter must be the return value of a previous call to regcomp() or regexec().

Returns:

The number of characters copied into the string.

Examples:

See regcomp().

Classification:

POSIX 1003.1a

Safety:
Cancellation point No
Interrupt handler Yes
Signal handler Yes
Thread Yes

Author:

Henry Spencer. For copyright information, see Third-Party Copyright Notices in this reference.

See also:

regcomp(), regexec(), regfree()


[Previous] [Contents] [Next]