Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)
regcomp(3) Guardian Native C Library Calls Reference Manual
NAME
regcomp, regerror, regexec, regfree - Perform regular expression matching
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
H-series OSS processes: /G/system/zdllnnn/zcrtldll
SYNOPSIS
#include <sys/types.h>
#include <regex.h>
int regcomp(
regex_t *preg,
const char *pattern,
int cflags);
size_t regerror(
int errcode,
const regex_t preg,
char *errbuf,
size_t errbuf_size);
int regexec(
const regex_t *preg,
const char *string,
size_t nmatch,
regmatch_t *pmatch,
int eflags);
void regfree(
regex_t *preg);
PARAMETERS
cflags Contains the bitwise inclusive OR of flags for regcomp().
The cflags parameter is the bitwise inclusive OR of zero or more of the following
flags. These flags are defined in the /usr/include/regex.h file.
REG_EXTENDED
Uses extended regular expressions.
REG_ICASE Ignores case in match.
REG_NOSUB If this flag is not set, the regcomp() function sets the
preg.re_nsub field to the number of parenthetic expressions
found in the pattern parameter. Otherwise, a subexpression will
result in an error.
REG_NEWLINE
Treats newline as a special character marking the end and begin-
ning of lines.
pattern Contains the basic or extended regular expression to be compiled by regcomp().
The default regular expression type for the pattern parameter is a basic regular
expression. An application can specify extended regular expressions with the
REG_EXTENDED flag. If the REG_NOSUB flag is not set in the cflags
parameter, the regcomp() function sets the number of parenthetic
5−60 Hewlett-Packard Company 527192-005