Lines Matching +full:- +full:algorithm
3 PCRE2 - Perl-compatible regular expressions (revised API)
9 string. The "standard" algorithm is the one provided by the \fBpcre2_match()\fP
11 Perl-compatible matching operation. The just-in-time (JIT) optimization that is
18 An alternative algorithm is provided by the \fBpcre2_dfa_match()\fP function;
19 it operates in a different way, and is not Perl-compatible. This alternative
20 has advantages and disadvantages compared with the standard algorithm, and
33 there are three possible answers. The standard algorithm finds only one of
34 them, whereas the alternative algorithm finds all three.
44 There are two ways to search a tree: depth-first and breadth-first, and these
48 .SH "THE STANDARD MATCHING ALGORITHM"
52 the standard algorithm is an "NFA algorithm". It conducts a depth-first search
55 the algorithm tries any alternatives at the current point, and if they all
62 the algorithm stops. Thus, if there is more than one possible match, this
63 algorithm returns the first one that it finds. Whether this is the shortest,
68 straightforward for this algorithm to keep track of the substrings that are
73 .SH "THE ALTERNATIVE MATCHING ALGORITHM"
76 This algorithm conducts a breadth-first search of the tree. Starting from the
80 this is a kind of "DFA algorithm", though it is not implemented as a
84 Although the general principle of this matching algorithm is that it scans the
92 Thus, if there is more than one possible match, this algorithm finds all of
94 decreasing order of length. There is an option to stop the algorithm after the
104 character of the subject. The algorithm does not automatically move on to find
107 PCRE2's "auto-possessification" optimization usually applies to character
116 supported by the alternative matching algorithm. They are as follows:
118 1. Because the algorithm finds all possible matches, the greedy or ungreedy
120 auto-possessification, as just described). During matching, greedy and ungreedy
128 non-possessive quantifier. Similarly, if an atomic group is present, it is
134 possibilities, and PCRE2's implementation of this algorithm does not attempt to
150 7. The \eC escape sequence, which (in the standard algorithm) always matches a
152 the alternative algorithm moves through the subject string one character (not
159 .SH "ADVANTAGES OF THE ALTERNATIVE ALGORITHM"
162 Using the alternative matching algorithm provides the following advantages:
166 match using the standard algorithm, you have to do kludgy things with
169 2. Because the alternative algorithm scans the subject string just once, and
172 partial matching each time. Although it is also possible to do multi-segment
173 matching using the standard algorithm, by retaining partially matched
178 documentation gives details of partial matching and discusses multi-segment
182 .SH "DISADVANTAGES OF THE ALTERNATIVE ALGORITHM"
185 The alternative algorithm suffers from a number of disadvantages:
187 1. It is substantially slower than the standard algorithm. This is partly
194 performance advantage that it does for the standard algorithm.
212 Copyright (c) 1997-2014 University of Cambridge.