Open System Services Library Calls Reference Manual (G06.28+, H06.05+)

OSS Library Calls (n - r) regex(3)
NAME
|
regex - 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 <libgen.h> |
char *regex(const char *re, |
const char *subject, |
char *se0, ...); |
extern const char *__loc1; |
PARAMETERS
|
re ||
Is a pointer to a compiled regular expression pattern created by the regcmp() |
function. |
sub- |
ject
Is a pointer to a string which will be searched for matches to the compiled regu- |
lar expression. |
se0, ... ||
Is a list of pointers to locations where the regex() function can store subexpres- |
sions. |
DESCRIPTION |
The regex() function executes the compiled regular expression pointed to by the re parameter |
against the string pointed to by the subject parameter. That is, it searches the string for matches |
to the regular expression pattern. The __loc1 global character pointer points to the rst matched |
character in the string pointed to by subject. The se0, ... parameters point to locations where the |
regex() function store any subexpressions needing to be returned. |
The following regular expression symbols are valid: |
[]*.ˆ ||
Have the same meanings as dened in the re_comp(3) reference page. |
$ ||
Matches the end of the string. The \n character matches a newline. |
- |
When used within brackets, signies an ASCII character range. For example, |
specifying [a-d] is the same as specifying [abcd]. If the hyphen is the rst or last |
character within the brackets, it represents itself. For example, [a-] matches two |
characers, a and -.|
+ ||
Matches one or more consecutive occurences of the preceding regular expres- |
sion. For example, [a-z]+ is the same as [a-z][a-z]*.|
527187-007 Hewlett-Packard Company 599