ViewVC logotype

Contents of /code/trunk/doc/pcre_exec.3

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1055 - (show annotations)
Tue Oct 16 15:53:30 2012 UTC (7 years, 3 months ago) by chpe
File size: 4333 byte(s)
pcre32: Add 32-bit library

Create libpcre32 that operates on 32-bit characters (UTF-32).

This turned out to be surprisingly simple after the UTF-16 support
was introduced; mostly just extra ifdefs and adjusting and adding
some tests.
1 .TH PCRE_EXEC 3 "24 June 2012" "PCRE 8.30"
3 PCRE - Perl-compatible regular expressions
5 .rs
6 .sp
7 .B #include <pcre.h>
8 .PP
9 .SM
10 .B int pcre_exec(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP,"
11 .ti +5n
12 .B "const char *\fIsubject\fP," int \fIlength\fP, int \fIstartoffset\fP,
13 .ti +5n
14 .B int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP);
15 .PP
16 .B int pcre16_exec(const pcre16 *\fIcode\fP, "const pcre16_extra *\fIextra\fP,"
17 .ti +5n
18 .B "PCRE_SPTR16 \fIsubject\fP," int \fIlength\fP, int \fIstartoffset\fP,
19 .ti +5n
20 .B int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP);
21 .PP
22 .B int pcre32_exec(const pcre32 *\fIcode\fP, "const pcre32_extra *\fIextra\fP,"
23 .ti +5n
24 .B "PCRE_SPTR32 \fIsubject\fP," int \fIlength\fP, int \fIstartoffset\fP,
25 .ti +5n
26 .B int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP);
27 .
29 .rs
30 .sp
31 This function matches a compiled regular expression against a given subject
32 string, using a matching algorithm that is similar to Perl's. It returns
33 offsets to captured substrings. Its arguments are:
34 .sp
35 \fIcode\fP Points to the compiled pattern
36 \fIextra\fP Points to an associated \fBpcre[16|32]_extra\fP structure,
37 or is NULL
38 \fIsubject\fP Points to the subject string
39 \fIlength\fP Length of the subject string, in bytes
40 \fIstartoffset\fP Offset in bytes in the subject at which to
41 start matching
42 \fIoptions\fP Option bits
43 \fIovector\fP Points to a vector of ints for result offsets
44 \fIovecsize\fP Number of elements in the vector (a multiple of 3)
45 .sp
46 The options are:
47 .sp
48 PCRE_ANCHORED Match only at the first position
49 PCRE_BSR_ANYCRLF \eR matches only CR, LF, or CRLF
50 PCRE_BSR_UNICODE \eR matches all Unicode line endings
51 PCRE_NEWLINE_ANY Recognize any Unicode newline sequence
52 PCRE_NEWLINE_ANYCRLF Recognize CR, LF, & CRLF as newline sequences
53 PCRE_NEWLINE_CR Recognize CR as the only newline sequence
54 PCRE_NEWLINE_CRLF Recognize CRLF as the only newline sequence
55 PCRE_NEWLINE_LF Recognize LF as the only newline sequence
56 PCRE_NOTBOL Subject string is not the beginning of a line
57 PCRE_NOTEOL Subject string is not the end of a line
58 PCRE_NOTEMPTY An empty string is not a valid match
59 PCRE_NOTEMPTY_ATSTART An empty string at the start of the subject
60 is not a valid match
61 PCRE_NO_START_OPTIMIZE Do not do "start-match" optimizations
62 PCRE_NO_UTF16_CHECK Do not check the subject for UTF-16
63 validity (only relevant if PCRE_UTF16
64 was set at compile time)
65 PCRE_NO_UTF32_CHECK Do not check the subject for UTF-32
66 validity (only relevant if PCRE_UTF32
67 was set at compile time)
68 PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8
69 validity (only relevant if PCRE_UTF8
70 was set at compile time)
71 PCRE_PARTIAL ) Return PCRE_ERROR_PARTIAL for a partial
72 PCRE_PARTIAL_SOFT ) match if no full matches are found
73 PCRE_PARTIAL_HARD Return PCRE_ERROR_PARTIAL for a partial match
74 if that is found before a full match
75 .sp
76 For details of partial matching, see the
77 .\" HREF
78 \fBpcrepartial\fP
79 .\"
80 page. A \fBpcre_extra\fP structure contains the following fields:
81 .sp
82 \fIflags\fP Bits indicating which fields are set
83 \fIstudy_data\fP Opaque data from \fBpcre[16|32]_study()\fP
84 \fImatch_limit\fP Limit on internal resource use
85 \fImatch_limit_recursion\fP Limit on internal recursion depth
86 \fIcallout_data\fP Opaque data passed back to callouts
87 \fItables\fP Points to character tables or is NULL
88 \fImark\fP For passing back a *MARK pointer
89 \fIexecutable_jit\fP Opaque data from JIT compilation
90 .sp
94 .P
95 There is a complete description of the PCRE native API in the
96 .\" HREF
97 \fBpcreapi\fP
98 .\"
99 page and a description of the POSIX API in the
100 .\" HREF
101 \fBpcreposix\fP
102 .\"
103 page.


Name Value
svn:eol-style native
svn:keywords "Author Date Id Revision Url"

  ViewVC Help
Powered by ViewVC 1.1.5