3 PCRE - Perl-compatible regular expressions
10 .B int pcre_exec(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP,"
12 .B "const char *\fIsubject\fP," int \fIlength\fP, int \fIstartoffset\fP,
14 .B int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP);
16 .B int pcre16_exec(const pcre16 *\fIcode\fP, "const pcre16_extra *\fIextra\fP,"
18 .B "PCRE_SPTR16 \fIsubject\fP," int \fIlength\fP, int \fIstartoffset\fP,
20 .B int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP);
25 This function matches a compiled regular expression against a given subject
26 string, using a matching algorithm that is similar to Perl's. It returns
27 offsets to captured substrings. Its arguments are:
29 \fIcode\fP Points to the compiled pattern
30 \fIextra\fP Points to an associated \fBpcre[16]_extra\fP structure,
32 \fIsubject\fP Points to the subject string
33 \fIlength\fP Length of the subject string, in bytes
34 \fIstartoffset\fP Offset in bytes in the subject at which to
36 \fIoptions\fP Option bits
37 \fIovector\fP Points to a vector of ints for result offsets
38 \fIovecsize\fP Number of elements in the vector (a multiple of 3)
42 PCRE_ANCHORED Match only at the first position
43 PCRE_BSR_ANYCRLF \eR matches only CR, LF, or CRLF
44 PCRE_BSR_UNICODE \eR matches all Unicode line endings
45 PCRE_NEWLINE_ANY Recognize any Unicode newline sequence
46 PCRE_NEWLINE_ANYCRLF Recognize CR, LF, & CRLF as newline sequences
47 PCRE_NEWLINE_CR Recognize CR as the only newline sequence
48 PCRE_NEWLINE_CRLF Recognize CRLF as the only newline sequence
49 PCRE_NEWLINE_LF Recognize LF as the only newline sequence
50 PCRE_NOTBOL Subject string is not the beginning of a line
51 PCRE_NOTEOL Subject string is not the end of a line
52 PCRE_NOTEMPTY An empty string is not a valid match
53 PCRE_NOTEMPTY_ATSTART An empty string at the start of the subject
55 PCRE_NO_START_OPTIMIZE Do not do "start-match" optimizations
56 PCRE_NO_UTF16_CHECK Do not check the subject for UTF-16
57 validity (only relevant if PCRE_UTF16
58 was set at compile time)
59 PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8
60 validity (only relevant if PCRE_UTF8
61 was set at compile time)
62 PCRE_PARTIAL ) Return PCRE_ERROR_PARTIAL for a partial
63 PCRE_PARTIAL_SOFT ) match if no full matches are found
64 PCRE_PARTIAL_HARD Return PCRE_ERROR_PARTIAL for a partial match
65 if that is found before a full match
67 For details of partial matching, see the
71 page. A \fBpcre_extra\fP structure contains the following fields:
73 \fIflags\fP Bits indicating which fields are set
74 \fIstudy_data\fP Opaque data from \fBpcre[16]_study()\fP
75 \fImatch_limit\fP Limit on internal resource use
76 \fImatch_limit_recursion\fP Limit on internal recursion depth
77 \fIcallout_data\fP Opaque data passed back to callouts
78 \fItables\fP Points to character tables or is NULL
79 \fImark\fP For passing back a *MARK pointer
80 \fIexecutable_jit\fP Opaque data from JIT compilation
82 The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT,
83 PCRE_EXTRA_MATCH_LIMIT_RECURSION, PCRE_EXTRA_CALLOUT_DATA,
84 PCRE_EXTRA_TABLES, PCRE_EXTRA_MARK and PCRE_EXTRA_EXECUTABLE_JIT.
86 There is a complete description of the PCRE native API in the
90 page and a description of the POSIX API in the