pcreposix.c
Translate error code to string
Synopsis
Prototype
size_t pcre_regerror (
int errcode,
const regex_t* preg,
char* errbuf,
size_t errbuf_size
);
Type | Name | Read/Write | Description |
int | errcode | Input | Error code |
const regex_t* | preg | Input | Compiled expresion |
char* | errbuf | Output | error buffer |
size_t | errbuf_size | Input | error buffer size |
size_t | | RETURN | Message length |
Input
errcode: | (Input) | Error code |
preg: | (Input) | Compiled expresion |
errbuf_size: | (Input) | error buffer size |
Output
errbuf: | (Output) | error buffer |
Returns
Description
Translate error code to string
Usage
See source code
Example
In preparation
Errors
See source code
Dependencies
See source code
See Also
See other functions in this section
Availability
In release 5.0.0
Free store held by a regex
Synopsis
Prototype
void pcre_regfree (
regex_t* preg
);
Type | Name | Read/Write | Description |
regex_t* | preg | Delete | Regex |
void | | RETURN | |
Output
Returns
Description
Free store held by a regex
Usage
See source code
Example
In preparation
Errors
See source code
Dependencies
See source code
See Also
See other functions in this section
Availability
In release 5.0.0
Compile a regular expression
Synopsis
Prototype
int pcre_regcomp (
regex_t* preg,
const char* pattern,
int cflags
);
Type | Name | Read/Write | Description |
regex_t* | preg | Output | points to a structure for recording
the compiled expression |
const char* | pattern | Input | the pattern to compile |
int | cflags | Input | compilation flags |
int | | RETURN | 0 on success
various non-zero codes on failure |
Input
pattern: | (Input) | the pattern to compile |
cflags: | (Input) | compilation flags |
Output
preg: | (Output) | points to a structure for recording
the compiled expression |
Returns
int: | 0 on success
various non-zero codes on failure |
Description
Compile a regular expression
Usage
See source code
Example
In preparation
Errors
See source code
Dependencies
See source code
See Also
See other functions in this section
Availability
In release 5.0.0
Match a regular expression
Unfortunately, PCRE requires 3 ints of working space for each captured
substring, so we have to get and release working store instead of just using
the POSIX structures as was done in earlier releases when PCRE needed only 2
ints. However, if the number of possible capturing brackets is small, use a
block of store on the stack, to reduce the use of malloc/free.
The threshold is in a macro that can be changed at configure time.
Synopsis
Prototype
int pcre_regexec (
const regex_t* preg,
const char* strng,
size_t nmatch,
regmatch_t[] pmatch,
int eflags
);
Type | Name | Read/Write | Description |
const regex_t* | preg | Input | Undocumented |
const char* | strng | Input | Undocumented |
size_t | nmatch | Input | Undocumented |
regmatch_t[] | pmatch | Modify | Undocumented |
int | eflags | Input | Undocumented |
int | | RETURN | Undocumented |
Input
preg: | (Input) | Undocumented |
strng: | (Input) | Undocumented |
nmatch: | (Input) | Undocumented |
eflags: | (Input) | Undocumented |
Input & Output
pmatch: | (Modify) | Undocumented |
Returns
Description
Match a regular expression
Unfortunately, PCRE requires 3 ints of working space for each captured
substring, so we have to get and release working store instead of just using
the POSIX structures as was done in earlier releases when PCRE needed only 2
ints. However, if the number of possible capturing brackets is small, use a
block of store on the stack, to reduce the use of malloc/free.
The threshold is in a macro that can be changed at configure time.
Usage
See source code
Example
In preparation
Errors
See source code
Dependencies
See source code
See Also
See other functions in this section
Availability
In release 5.0.0