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 cags);
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 eags);
void regfree(
regex_t *preg);
PARAMETERS
cflags Contains the bitwise inclusive OR of ags for regcomp().
The cags parameter is the bitwise inclusive OR of zero or more of the following
ags. These ags are dened in the /usr/include/regex.h le.
REG_EXTENDED
Uses extended regular expressions.
REG_ICASE Ignores case in match.
REG_NOSUB If this ag is not set, the regcomp() function sets the
preg.re_nsub eld 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 ag. If the REG_NOSUB ag is not set in the cags
parameter, the regcomp() function sets the number of parenthetic
560 Hewlett-Packard Company 527192-005