1PCRE_DFA_EXEC(3) Library Functions Manual PCRE_DFA_EXEC(3)
2
3
4
6 PCRE - Perl-compatible regular expressions
7
9
10 #include <pcre.h>
11
12 int pcre_dfa_exec(const pcre *code, const pcre_extra *extra,
13 const char *subject, int length, int startoffset,
14 int options, int *ovector, int ovecsize,
15 int *workspace, int wscount);
16
18
19 This function matches a compiled regular expression against a given
20 subject string, using an alternative matching algorithm that scans the
21 subject string just once (not Perl-compatible). Note that the main,
22 Perl-compatible, matching function is pcre_exec(). The arguments for
23 this function are:
24
25 code Points to the compiled pattern
26 extra Points to an associated pcre_extra structure,
27 or is NULL
28 subject Points to the subject string
29 length Length of the subject string, in bytes
30 startoffset Offset in bytes in the subject at which to
31 start matching
32 options Option bits
33 ovector Points to a vector of ints for result offsets
34 ovecsize Number of elements in the vector
35 workspace Points to a vector of ints used as working space
36 wscount Number of elements in the vector
37
38 The options are:
39
40 PCRE_ANCHORED Match only at the first position
41 PCRE_BSR_ANYCRLF \R matches only CR, LF, or CRLF
42 PCRE_BSR_UNICODE \R matches all Unicode line endings
43 PCRE_NEWLINE_ANY Recognize any Unicode newline sequence
44 PCRE_NEWLINE_ANYCRLF Recognize CR, LF, and CRLF as newline sequences
45 PCRE_NEWLINE_CR Set CR as the newline sequence
46 PCRE_NEWLINE_CRLF Set CRLF as the newline sequence
47 PCRE_NEWLINE_LF Set LF as the newline sequence
48 PCRE_NOTBOL Subject is not the beginning of a line
49 PCRE_NOTEOL Subject is not the end of a line
50 PCRE_NOTEMPTY An empty string is not a valid match
51 PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8
52 validity (only relevant if PCRE_UTF8
53 was set at compile time)
54 PCRE_PARTIAL Return PCRE_ERROR_PARTIAL for a partial match
55 PCRE_DFA_SHORTEST Return only the shortest match
56 PCRE_DFA_RESTART This is a restart after a partial match
57
58 There are restrictions on what may appear in a pattern when using this
59 matching function. Details are given in the pcrematching documentation.
60
61 A pcre_extra structure contains the following fields:
62
63 flags Bits indicating which fields are set
64 study_data Opaque data from pcre_study()
65 match_limit Limit on internal resource use
66 match_limit_recursion Limit on internal recursion depth
67 callout_data Opaque data passed back to callouts
68 tables Points to character tables or is NULL
69
70 The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT,
71 PCRE_EXTRA_MATCH_LIMIT_RECURSION, PCRE_EXTRA_CALLOUT_DATA, and
72 PCRE_EXTRA_TABLES. For this matching function, the match_limit and
73 match_limit_recursion fields are not used, and must not be set.
74
75 There is a complete description of the PCRE native API in the pcreapi
76 page and a description of the POSIX API in the pcreposix page.
77
78
79
80 PCRE_DFA_EXEC(3)