Open System Services Library Calls Reference Manual (G06.28+, H06.05+)
OSS Library Calls (n - r) re_comp(3)
NAME
|
re_comp - Compiles 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> |
char *re_comp( |
const char *re_string); |
PARAMETERS
|
re_string ||
Is a pointer to the regular expression string to be compiled by the re_comp() |
function. |
DESCRIPTION |
The re_comp() function takes the regular expression string pointed to by the re_string parame- |
ter and compiles it into an internal form that can be used for pattern matching. |
If the re_comp() function is called with the re_string parameter being a null pointer, the last reg- |
ular expression compiled remains the one used by the re_exec() function. |
The re_comp() 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 (circumflex) is only special when it appears at the beginning of |
a regular expression string or when it is the first 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. |
527187-007 Hewlett-Packard Company 5−81