Home | History | Annotate | Download | only in regex

Lines Matching refs:pattern

107 /* This must be nonzero for the wordchar and notwordchar pattern
368 the range 0 to one less than the pattern buffer's re_nsub
378 pattern buffer, and one byte with the number of inner groups,
476 /* Common operations on the compiled pattern. */
609 /* Print a compiled pattern string in human-readable form, starting at
627 /* Loop over pattern commands. */
839 printf ("%d:\tend of pattern.\n", p - start);
914 also be assigned to arbitrarily: each pattern buffer stores its own
1211 DEBUG_PRINT2 (" Pushing pattern 0x%x: ", pattern_place); \
1257 PAT -- the saved pattern position.
1295 DEBUG_PRINT2 (" Popping pattern 0x%x: ", pat); \
1403 /* Fetch the next character in the uncompiled pattern---translating it
1415 /* Fetch the next character in the uncompiled pattern, with no
1422 /* Go backwards one character in the pattern. */
1436 /* Macros for outputting the compiled pattern into `buffer'. */
1492 into the pattern are two bytes long. So if 2^16 bytes turns out to
1576 /* Get the next unsigned number in the uncompiled pattern. */
1653 /* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX.
1661 `buffer' is the compiled pattern;
1663 `used' is set to the length of the compiled pattern;
1665 `re_nsub' is the number of subexpressions in PATTERN;
1676 regex_compile (pattern, size, syntax, bufp)
1677 const char *pattern;
1682 /* We fetch characters from PATTERN here. Even though PATTERN is
1687 /* A random temporary spot in PATTERN. */
1696 /* Points to the current (ending) position in the pattern. */
1697 const char *p = pattern;
1698 const char *pend = pattern + size;
1700 /* How to translate the characters in the pattern. */
1717 /* Place in the uncompiled pattern (i.e., the {) to
1732 DEBUG_PRINT1 ("\nCompiling pattern: ");
1738 putchar (pattern[debug_count]);
1751 /* Initialize the pattern buffer. */
1756 /* Set `used' to zero, so that if we return an error, the pattern
1757 printer (for debugging) will think there's no pattern. We reset it
1788 /* Loop through the uncompiled pattern until we're at the end. */
1797 if ( /* If at start of pattern, it's an operator. */
1798 p == pattern + 1
1802 || at_begline_loc_p (pattern, p, syntax))
1812 if ( /* If at end of pattern, it's an operator. */
1832 /* If there is no previous pattern... */
1890 /* Star, etc. applied to an empty pattern is equivalent
1891 to an empty pattern. */
1908 assert (p - 1 > pattern);
1913 /* We know we are not at the first character of the pattern,
2029 && !(p - 2 >= pattern && p[-2] == '[')
2030 && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
2059 /* If pattern is `[[:'. */
2213 whole pattern moves because of realloc, they will still
2224 represent in the compiled pattern. */
2364 || (p - 2 == pattern && p == pend))
2443 we're all done, the pattern will look like:
2493 inserting into the middle of the pattern --
2522 if (p > pattern && p[-1] == '\\')
2658 /* Through the pattern now. */
2667 the first time we reach the end of the compiled pattern. */
2679 DEBUG_PRINT1 ("\nCompiled pattern: \n");
2797 /* P points to just after a ^ in PATTERN. Return true if that ^ comes
2802 at_begline_loc_p (pattern, p, syntax)
2803 const char *pattern, *p;
2807 boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
2860 uncompiled pattern *P_PTR (which ends at PEND). We assume the
2863 ending characters (inclusive) in the compiled pattern B.
2885 /* Even though the pattern is a signed `char *', we need to fetch
2886 with unsigned char *'s; if the high bit of the pattern character
2896 /* Have to increment the pointer into the pattern string, so the
2917 /* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in
2919 characters can start a string that matches the pattern. This fastmap
2926 the pattern buffer.
2945 unsigned char *pattern = bufp->buffer;
2947 unsigned char *p = pattern;
2948 register unsigned char *pend = pattern + size;
2956 /* Assume that each path through the pattern can be null until
2976 /* We have reached the (effective) end of pattern. */
2992 /* We should never be about to go beyond the end of the pattern. */
3148 end of the pattern. We don't want to push such a point,
3150 increment `p' past the end of the pattern. We don't need
3152 fastmap entries beyond `pend'. Such a pattern can match
3205 characters for one path of the pattern -- and that the empty
3215 pattern is empty). */
3277 /* Using the compiled pattern in BUFP->buffer, first tries to match the
3328 search for a pattern that must be anchored. */
3353 /* See whether the pattern is anchored. */
3360 /* If the pattern is anchored,
3374 cannot be the start of a match. If the pattern can match the
3529 we use only one byte in the pattern for the register number), we can
3558 /* re_match_2 matches the compiled pattern in BUFP against the
3611 /* Where we are in the pattern, and the end of the pattern. */
3627 to resume scanning the pattern; the second one is where to resume
3656 attempt) by a subexpression part of the pattern, that is, the
3657 regnum-th regstart pointer points to where in the pattern we began
3660 keeps track of what the whole pattern matches.) */
3677 matched any of the pattern so far this time through the reg_num-th
3723 no groups in the pattern, as it takes a fair amount of time. If
3725 pattern), even though we never use it, since it simplifies the
3801 /* `p' scans through the pattern as `d' scans through the data.
3818 DEBUG_PRINT1 ("The compiled pattern is: ");
3824 /* This loops over pattern commands. It exits by returning from the
3832 { /* End of pattern means we might have succeeded. */
3833 DEBUG_PRINT1 ("end of pattern ... ");
3883 For example, the pattern `x.*y.*z' against the
3971 were in the pattern, set the extra elements to -1. If
3994 /* Otherwise match next pattern command. */
4007 /* Match the next n pattern characters exactly. The following
4008 byte in the pattern defines n, and the n bytes after that
4222 /* If the next operation is a jump backwards in the pattern
4226 on_failure_jump's jump in the pattern, and d. */
4474 pattern follows its end. If we can establish that there
4508 /* If we're at the end of the pattern, we can change. */
4516 (" End of pattern: change to `pop_failure_jump'.\n");
4617 on_failure_jump; we got through the pattern to here from the
4657 pop_failure_jump, also, and with a pattern of, say, `a+', we
4663 the code at `fail' tests is the value for the pattern. */
4870 continue; /* Successfully executed one pattern command; keep going. */
4886 /* If we failed to the end of the pattern, don't examine *p. */
4936 Return true if the pattern up to the corresponding stop_memory can
4967 pattern. */
4975 with a jump, e.g., here is the pattern for `a|b|c':
5197 compiles PATTERN (of length SIZE) and puts the result in BUFP.
5198 Returns 0 if the pattern was valid, otherwise an error string.
5206 re_compile_pattern (pattern, length, bufp)
5207 const char *pattern;
5225 ret = regex_compile (pattern, length, re_syntax_options, bufp);
5238 /* BSD has one and only one pattern buffer. */
5273 don't need to initialize the pattern buffer fields which affect it. */
5311 `buffer' to the compiled pattern;
5312 `used' to the length of the compiled pattern;
5318 `re_nsub' to the number of subexpressions in PATTERN.
5320 PATTERN is the address of the pattern string.
5341 regcomp (preg, pattern, cflags)
5343 const char *pattern;
5351 /* regex_compile will allocate the space for the compiled pattern. */
5392 /* POSIX says a null character in the pattern terminates it, so we
5393 can use strlen here in compiling the pattern. */
5394 ret = regex_compile (pattern, strlen (pattern), syntax, preg);
5404 /* regexec searches for a given pattern, specified by PREG, in the