new upstream release (3.3.0); modify package compatibility for Stretch
[ossec-hids.git] / src / external / pcre2-10.32 / doc / pcre2_dfa_match.3
1 .TH PCRE2_DFA_MATCH 3 "26 April 2018" "PCRE2 10.32"
2 .SH NAME
3 PCRE2 - Perl-compatible regular expressions (revised API)
4 .SH SYNOPSIS
5 .rs
6 .sp
7 .B #include <pcre2.h>
8 .PP
9 .nf
10 .B int pcre2_dfa_match(const pcre2_code *\fIcode\fP, PCRE2_SPTR \fIsubject\fP,
11 .B "  PCRE2_SIZE \fIlength\fP, PCRE2_SIZE \fIstartoffset\fP,"
12 .B "  uint32_t \fIoptions\fP, pcre2_match_data *\fImatch_data\fP,"
13 .B "  pcre2_match_context *\fImcontext\fP,"
14 .B "  int *\fIworkspace\fP, PCRE2_SIZE \fIwscount\fP);"
15 .fi
16 .
17 .SH DESCRIPTION
18 .rs
19 .sp
20 This function matches a compiled regular expression against a given subject
21 string, using an alternative matching algorithm that scans the subject string
22 just once (except when processing lookaround assertions). This function is
23 \fInot\fP Perl-compatible (the Perl-compatible matching function is
24 \fBpcre2_match()\fP). The arguments for this function are:
25 .sp
26   \fIcode\fP         Points to the compiled pattern
27   \fIsubject\fP      Points to the subject string
28   \fIlength\fP       Length of the subject string
29   \fIstartoffset\fP  Offset in the subject at which to start matching
30   \fIoptions\fP      Option bits
31   \fImatch_data\fP   Points to a match data block, for results
32   \fImcontext\fP     Points to a match context, or is NULL
33   \fIworkspace\fP    Points to a vector of ints used as working space
34   \fIwscount\fP      Number of elements in the vector
35 .sp
36 For \fBpcre2_dfa_match()\fP, a match context is needed only if you want to set
37 up a callout function or specify the heap limit or the match or the recursion
38 depth limits. The \fIlength\fP and \fIstartoffset\fP values are code units, not
39 characters. The options are:
40 .sp
41   PCRE2_ANCHORED          Match only at the first position
42   PCRE2_ENDANCHORED       Pattern can match only at end of subject
43   PCRE2_NOTBOL            Subject is not the beginning of a line
44   PCRE2_NOTEOL            Subject is not the end of a line
45   PCRE2_NOTEMPTY          An empty string is not a valid match
46 .\" JOIN
47   PCRE2_NOTEMPTY_ATSTART  An empty string at the start of the subject
48                            is not a valid match
49 .\" JOIN
50   PCRE2_NO_UTF_CHECK      Do not check the subject for UTF
51                            validity (only relevant if PCRE2_UTF
52                            was set at compile time)
53 .\" JOIN
54   PCRE2_PARTIAL_HARD      Return PCRE2_ERROR_PARTIAL for a partial
55                            match even if there is a full match
56 .\" JOIN
57   PCRE2_PARTIAL_SOFT      Return PCRE2_ERROR_PARTIAL for a partial
58                            match if no full matches are found
59   PCRE2_DFA_RESTART       Restart after a partial match
60   PCRE2_DFA_SHORTEST      Return only the shortest match
61 .sp
62 There are restrictions on what may appear in a pattern when using this matching
63 function. Details are given in the
64 .\" HREF
65 \fBpcre2matching\fP
66 .\"
67 documentation. For details of partial matching, see the
68 .\" HREF
69 \fBpcre2partial\fP
70 .\"
71 page. There is a complete description of the PCRE2 native API in the
72 .\" HREF
73 \fBpcre2api\fP
74 .\"
75 page and a description of the POSIX API in the
76 .\" HREF
77 \fBpcre2posix\fP
78 .\"
79 page.