Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)

Guardian Native C Library Calls (n - r) re_exec(3)
NAME
re_exec - Executes regular expressions
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZSTFNSRL
G-series native OSS processes: /G/system/sysnn/zstfnsrl
H-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
H-series OSS processes: /G/system/zdllnnn/zcrtldll
SYNOPSIS
#include <re_comp.h>
int re_exec(
const char *string);
PARAMETERS
string Is a pointer to the string that the re_exec() function searches for matches to the
last compiled regular expression.
DESCRIPTION
The re_exec() function compares the string pointed to by the string parameter with the last reg-
ular expression compiled by the re_comp() function.
The re_exec() function supports simple regular expressions.
The following one-character regular expression strings match a single character:
1. An ordinary character (not one of the special characters discussed in paragraph 2) is a
one-character regular expression string that matches itself.
2. A backslash (\) followed by a special character is one-character regular expression string
that matches a literal appearance of that character itself. Some special characters are
always special characters while others are only special in certain circumstances.
Characters that are special when they appear anywhere but inside square brack-
ets ([ ]) are "." (period), "*" (asterisk), "[" (left square bracket), and "\"
(backslash).
The "ˆ" character (circumex) is only special when it appears at the beginning of
a regular expression string or when it is the rst character with a set of square
brackets.
The "$" character (dollar sign) is only special when it appears at the very end of
a regular expression string.
Any character used to delimit a regular expression string is special for that regu-
lar expression string.
3. A period (.) is a one-character regular expression string that matches any one single char-
acter except newline.
4. A set of square brackets containing a non-empty string of characters is a one-character
regular expression string that matches any one character found within the brackets.
When the rst character of the bracketed string is a "ˆ" (caret or circumex), the one-
character regular expression string matches any one character except the new-line and
those characters following the "ˆ" in the bracketed string.
Within the bracketed string, a minus sign (-) can be used to specify a range of consecu-
tive ASCII characters. For example, [0-9] is the same as [0123456789]. If, however, the
527192-005 Hewlett-Packard Company 555