| 1 |
nigel |
79 |
.TH PCRE_EXEC 3 |
| 2 |
nigel |
63 |
.SH NAME |
| 3 |
|
|
PCRE - Perl-compatible regular expressions |
| 4 |
|
|
.SH SYNOPSIS |
| 5 |
|
|
.rs |
| 6 |
|
|
.sp |
| 7 |
|
|
.B #include <pcre.h> |
| 8 |
|
|
.PP |
| 9 |
|
|
.SM |
| 10 |
|
|
.br |
| 11 |
nigel |
75 |
.B int pcre_exec(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP," |
| 12 |
nigel |
63 |
.ti +5n |
| 13 |
nigel |
75 |
.B "const char *\fIsubject\fP," int \fIlength\fP, int \fIstartoffset\fP, |
| 14 |
nigel |
63 |
.ti +5n |
| 15 |
nigel |
75 |
.B int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP); |
| 16 |
|
|
. |
| 17 |
nigel |
63 |
.SH DESCRIPTION |
| 18 |
|
|
.rs |
| 19 |
|
|
.sp |
| 20 |
|
|
This function matches a compiled regular expression against a given subject |
| 21 |
nigel |
77 |
string, using a matching algorithm that is similar to Perl's. It returns |
| 22 |
|
|
offsets to captured substrings. Its arguments are: |
| 23 |
nigel |
75 |
.sp |
| 24 |
|
|
\fIcode\fP Points to the compiled pattern |
| 25 |
|
|
\fIextra\fP Points to an associated \fBpcre_extra\fP structure, |
| 26 |
nigel |
63 |
or is NULL |
| 27 |
nigel |
75 |
\fIsubject\fP Points to the subject string |
| 28 |
|
|
\fIlength\fP Length of the subject string, in bytes |
| 29 |
|
|
\fIstartoffset\fP Offset in bytes in the subject at which to |
| 30 |
nigel |
63 |
start matching |
| 31 |
nigel |
75 |
\fIoptions\fP Option bits |
| 32 |
|
|
\fIovector\fP Points to a vector of ints for result offsets |
| 33 |
|
|
\fIovecsize\fP Number of elements in the vector (a multiple of 3) |
| 34 |
|
|
.sp |
| 35 |
nigel |
63 |
The options are: |
| 36 |
nigel |
75 |
.sp |
| 37 |
nigel |
63 |
PCRE_ANCHORED Match only at the first position |
| 38 |
|
|
PCRE_NOTBOL Subject is not the beginning of a line |
| 39 |
|
|
PCRE_NOTEOL Subject is not the end of a line |
| 40 |
|
|
PCRE_NOTEMPTY An empty string is not a valid match |
| 41 |
nigel |
71 |
PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8 |
| 42 |
|
|
validity (only relevant if PCRE_UTF8 |
| 43 |
|
|
was set at compile time) |
| 44 |
nigel |
75 |
PCRE_PARTIAL Return PCRE_ERROR_PARTIAL for a partial match |
| 45 |
|
|
.sp |
| 46 |
|
|
There are restrictions on what may appear in a pattern when partial matching is |
| 47 |
|
|
requested. |
| 48 |
|
|
.P |
| 49 |
|
|
A \fBpcre_extra\fP structure contains the following fields: |
| 50 |
|
|
.sp |
| 51 |
|
|
\fIflags\fP Bits indicating which fields are set |
| 52 |
|
|
\fIstudy_data\fP Opaque data from \fBpcre_study()\fP |
| 53 |
|
|
\fImatch_limit\fP Limit on internal recursion |
| 54 |
|
|
\fIcallout_data\fP Opaque data passed back to callouts |
| 55 |
|
|
\fItables\fP Points to character tables or is NULL |
| 56 |
|
|
.sp |
| 57 |
|
|
The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT, |
| 58 |
|
|
PCRE_EXTRA_CALLOUT_DATA, and PCRE_EXTRA_TABLES. |
| 59 |
|
|
.P |
| 60 |
|
|
There is a complete description of the PCRE native API in the |
| 61 |
nigel |
63 |
.\" HREF |
| 62 |
nigel |
75 |
\fBpcreapi\fP |
| 63 |
nigel |
63 |
.\" |
| 64 |
nigel |
75 |
page and a description of the POSIX API in the |
| 65 |
|
|
.\" HREF |
| 66 |
|
|
\fBpcreposix\fP |
| 67 |
|
|
.\" |
| 68 |
nigel |
63 |
page. |