Lines Matching defs:match

67 /* Masks for identifying the public options that are permitted at match time. */
79 /* Non-error returns from and within the match() function. Error returns are
85 /* Special internal returns used in the match() function. Make them
206 mb points to the match block
207 match_data points to the match data block
260 mb points to the match block
283 the overall match offsets (which would waste space in the frame). For backward
338 the offsets that have so far been used in the match. Note that in caseless
347 mb points to match block
350 Returns: = 0 sucessful match; number of code units matched is set
351 < 0 no match
352 > 0 partial match
364 /* Deal with an unset group. The default is no match, but there is an option to
365 match an empty string. */
374 else return -1; /* No match */
405 if (eptr >= mb->end_subject) return 1; /* Partial match */
424 if (c < *pp) return -1; /* No match */
438 if (eptr >= mb->end_subject) return 1; /* Partial match */
442 return -1; /* No match */
459 if (eptr >= mb->end_subject) return 1; /* Partial match */
460 if (UCHAR21INCTEST(p) != UCHAR21INCTEST(eptr)) return -1; /* No match */
469 if (memcmp(p, eptr, CU2BYTES(length)) != 0) return -1; /* No match */
482 "Recursion" in the match() function
484 The original match() function was highly recursive, but this proved to be the
491 match() recursively, but this ran substantially slower. The current version is
511 * Macros for the match() function *
520 which adding more characters may allow the current match to continue.
522 For hard partial matching, we immediately return a partial match. Otherwise,
523 carrying on means that a complete match on the current subject will be sought.
524 A partial match is returned only if no complete match can be found. */
542 call to the match() function by means of a local vector of frames which
565 /* This function is called to run one match attempt at a single starting point
582 MATCH_NOMATCH if failed to match )
589 match(PCRE2_SPTR start_eptr, PCRE2_SPTR start_ecode, uint16_t top_bracket,
649 Fstart_match = Feptr = start_eptr; /* Current data pointer and start match */
846 /* Not a recursion. Fail for an empty string match if either PCRE2_NOTEMPTY
857 /* Also fail if PCRE2_ENDANCHORED is set and the end of the match is not
858 the end of the subject. After (*ACCEPT) we fail the entire match (at this
868 /* We have a successful match of the whole pattern. Record the result and
927 match any code unit, even newline. (It really should be called ANYCODEUNIT,
1076 RRETURN(MATCH_NOMATCH); /* Caseful match */
1099 RRETURN(MATCH_NOMATCH); /* Caseful match */
1211 match; if there isn't one, advance up to the maximum, one character at a
1216 then done (no backing up). Otherwise, match at this position; anything
1217 other than no match is immediately returned. For nomatch, back up one
1481 positive/negative option for each character match. Maybe that wouldn't add
3437 subsequent match. This means we cannot use a local "notmatch" variable as
4957 if (rrc > 0) Feptr = mb->end_subject; /* Partial match */
4991 if (rrc > 0) Feptr = mb->end_subject; /* Partial match */
5015 if (rrc > 0) Feptr = mb->end_subject; /* Partial match */
5202 if (Feptr == Lstart_eptr) /* Empty match; skip to end */
5245 /* Handle non-capturing brackets that cannot match an empty string. When we
5295 /* Atomic groups and non-capturing brackets that can match an empty string
5489 details of the match so far. This is mainly for debugging, though the
5617 /* In the case of a match, the captures have already been put into
5634 /* These force no match without checking other branches. */
5666 group that might match an empty string. We must therefore descend a level
5757 match, discarding any intermediate backtracking points. Copy back the
5760 seems to match what Perl does. */
6022 /* Start of match assertion */
6031 /* Reset the start of match point */
6127 argument. It is passed back in mb->verb_skip_ptr. If it does match, we
6181 nomatch_mark. When a pattern match ends with a SKIP_ARG for which there was
6182 not a matching mark, we have to re-run the match, ignoring the SKIP_ARG
6185 SKIP_ARG gets to top level, the match is re-run with mb->ignore_skip_arg
6305 = -1 => failed to match (PCRE2_ERROR_NOMATCH)
6306 = -2 => partial match (PCRE2_ERROR_PARTIAL)
6365 /* We need to have mb as a pointer to a match block, because the IS_NEWLINE
6402 /* PCRE2_NOTEMPTY and PCRE2_NOTEMPTY_ATSTART are match-time flags in the
6410 that the match-time bits are not more significant than the flag bits. If by
6456 /* If the match data block was previously used with PCRE2_COPY_MATCHED_SUBJECT,
6457 free the memory that was obtained. Set the field to NULL for no match cases. */
6700 /* Otherwise, set the not end of line option, and do the match. */
6711 /* A NULL match context means "use a default context", but we take the memory
6728 in the match block. */
6736 /* Fill in the remaining fields in the match block, except for moptions, which
6815 /* Limits set in the pattern override the match context only if they are
6870 /* Set up the first code unit to match, if available. If there's no first code
6934 /* ----------------- Start of match optimizations ---------------- */
6936 /* There are some optimizations that avoid running the match if a known
6943 /* If firstline is TRUE, the start of the match is constrained to the first
6944 line of a multiline string. That is, the match must be before or at the
6947 If the match fails at the newline, later code breaks the loop. */
6968 pointless but it can help in detecting a no match case without scanning for
7080 true end of the subject, break the bumpalong loop, to force a match
7098 multiline match if required. */
7119 ANYCRLF, and we are now at a LF, advance the match position by one
7168 may actually match the pattern. Although the value is, strictly, in
7179 subject for the (non-partial) match to succeed. If the first code unit is
7181 the match point. This optimization can save a huge amount of backtracking
7182 in patterns with nested unlimited repeats that aren't going to match.
7184 as does using an autoincrement and backing off on a match. As in the case
7244 forcing a match failure. */
7262 /* ------------ End of start of match optimizations ------------ */
7264 /* Give no match if we have passed the bumpalong limit. */
7272 /* OK, we can now run the match. If "hitend" is set afterwards, remember the
7273 first starting point for which a partial match was found. */
7289 rc = match(start_match, mb->start_code, re->top_bracket, frame_size,
7302 entirely. The only way we can do that is to re-do the match at the same
7313 greater than the match we have just done, treat it as NOMATCH. */
7344 /* Any other return is either a match, or some kind of error. */
7350 /* Control reaches here for the various types of "no match at this point"
7355 /* If PCRE2_FIRSTLINE is set, the match must happen before or at the first
7357 if we have just failed to match, starting at a newline, do not continue. */
7372 or ANY or ANYCRLF, advance the match position by one more code unit. In
7387 mb->mark = NULL; /* Reset for start of next match attempt */
7394 (1) The match succeeded, either completely, or partially;
7396 (2) The pattern is anchored or the match was failed after (*COMMIT);
7400 (4) PCRE2_FIRSTLINE is set and we have failed to match at a newline, because
7401 this option requests that a match occur at or before the first newline in
7411 and have just processed a non-terminal fragment. If this resulted in no match
7412 or a partial match we must carry on to the next fragment (a partial match is
7414 avoid trying to match against empty fragments; if the pattern can match an
7473 /* Fill in fields that are always returned in the match data. */
7479 /* Handle a fully successful match. Set the return code to the number of
7505 /* Control gets here if there has been a partial match, an error, or if the
7506 overall match attempt has failed at all permitted starting positions. Any mark
7511 /* For anything other than nomatch or partial match, just return the code. */
7515 /* Handle a partial match. If a "soft" partial match was requested, searching
7516 for a complete match will have continued, and the value of rc at this point
7517 will be MATCH_NOMATCH. For a "hard" partial match, it will already be