Tristan Matthews | 0461646 | 2013-11-14 16:09:34 -0500 | [diff] [blame] | 1 | .TH PCRE_DFA_EXEC 3 |
| 2 | .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 | .B int pcre_dfa_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 | .ti +5n |
| 16 | .B int *\fIworkspace\fP, int \fIwscount\fP); |
| 17 | . |
| 18 | .SH DESCRIPTION |
| 19 | .rs |
| 20 | .sp |
| 21 | This function matches a compiled regular expression against a given subject |
| 22 | string, using an alternative matching algorithm that scans the subject string |
| 23 | just once (\fInot\fP Perl-compatible). Note that the main, Perl-compatible, |
| 24 | matching function is \fBpcre_exec()\fP. The arguments for this function are: |
| 25 | .sp |
| 26 | \fIcode\fP Points to the compiled pattern |
| 27 | \fIextra\fP Points to an associated \fBpcre_extra\fP structure, |
| 28 | or is NULL |
| 29 | \fIsubject\fP Points to the subject string |
| 30 | \fIlength\fP Length of the subject string, in bytes |
| 31 | \fIstartoffset\fP Offset in bytes in the subject at which to |
| 32 | start matching |
| 33 | \fIoptions\fP Option bits |
| 34 | \fIovector\fP Points to a vector of ints for result offsets |
| 35 | \fIovecsize\fP Number of elements in the vector |
| 36 | \fIworkspace\fP Points to a vector of ints used as working space |
| 37 | \fIwscount\fP Number of elements in the vector |
| 38 | .sp |
| 39 | The options are: |
| 40 | .sp |
| 41 | PCRE_ANCHORED Match only at the first position |
| 42 | PCRE_BSR_ANYCRLF \eR matches only CR, LF, or CRLF |
| 43 | PCRE_BSR_UNICODE \eR matches all Unicode line endings |
| 44 | PCRE_NEWLINE_ANY Recognize any Unicode newline sequence |
| 45 | PCRE_NEWLINE_ANYCRLF Recognize CR, LF, & CRLF as newline sequences |
| 46 | PCRE_NEWLINE_CR Recognize CR as the only newline sequence |
| 47 | PCRE_NEWLINE_CRLF Recognize CRLF as the only newline sequence |
| 48 | PCRE_NEWLINE_LF Recognize LF as the only newline sequence |
| 49 | PCRE_NOTBOL Subject is not the beginning of a line |
| 50 | PCRE_NOTEOL Subject is not the end of a line |
| 51 | PCRE_NOTEMPTY An empty string is not a valid match |
| 52 | PCRE_NOTEMPTY_ATSTART An empty string at the start of the subject |
| 53 | is not a valid match |
| 54 | PCRE_NO_START_OPTIMIZE Do not do "start-match" optimizations |
| 55 | PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8 |
| 56 | validity (only relevant if PCRE_UTF8 |
| 57 | was set at compile time) |
| 58 | PCRE_PARTIAL ) Return PCRE_ERROR_PARTIAL for a partial |
| 59 | PCRE_PARTIAL_SOFT ) match if no full matches are found |
| 60 | PCRE_PARTIAL_HARD Return PCRE_ERROR_PARTIAL for a partial match |
| 61 | even if there is a full match as well |
| 62 | PCRE_DFA_SHORTEST Return only the shortest match |
| 63 | PCRE_DFA_RESTART Restart after a partial match |
| 64 | .sp |
| 65 | There are restrictions on what may appear in a pattern when using this matching |
| 66 | function. Details are given in the |
| 67 | .\" HREF |
| 68 | \fBpcrematching\fP |
| 69 | .\" |
| 70 | documentation. For details of partial matching, see the |
| 71 | .\" HREF |
| 72 | \fBpcrepartial\fP |
| 73 | .\" |
| 74 | page. |
| 75 | .P |
| 76 | A \fBpcre_extra\fP structure contains the following fields: |
| 77 | .sp |
| 78 | \fIflags\fP Bits indicating which fields are set |
| 79 | \fIstudy_data\fP Opaque data from \fBpcre_study()\fP |
| 80 | \fImatch_limit\fP Limit on internal resource use |
| 81 | \fImatch_limit_recursion\fP Limit on internal recursion depth |
| 82 | \fIcallout_data\fP Opaque data passed back to callouts |
| 83 | \fItables\fP Points to character tables or is NULL |
| 84 | \fImark\fP For passing back a *MARK pointer |
| 85 | \fIexecutable_jit\fP Opaque data from JIT compilation |
| 86 | .sp |
| 87 | The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT, |
| 88 | PCRE_EXTRA_MATCH_LIMIT_RECURSION, PCRE_EXTRA_CALLOUT_DATA, |
| 89 | PCRE_EXTRA_TABLES, PCRE_EXTRA_MARK and PCRE_EXTRA_EXECUTABLE_JIT. For this |
| 90 | matching function, the \fImatch_limit\fP and \fImatch_limit_recursion\fP fields |
| 91 | are not used, and must not be set. The PCRE_EXTRA_EXECUTABLE_JIT flag and |
| 92 | the corresponding variable are ignored. |
| 93 | .P |
| 94 | There is a complete description of the PCRE native API in the |
| 95 | .\" HREF |
| 96 | \fBpcreapi\fP |
| 97 | .\" |
| 98 | page and a description of the POSIX API in the |
| 99 | .\" HREF |
| 100 | \fBpcreposix\fP |
| 101 | .\" |
| 102 | page. |