Lines Matching refs:pattern

28  * grep - pattern matching program - combined grep, egrep, and fgrep.
68 static int bmglen; /* length of BMG pattern */
69 static char *bmgpat; /* BMG pattern */
73 char *pattern; /* original pattern */
74 wchar_t *wpattern; /* wide, lowercased pattern */
76 regex_t re; /* compiled pattern */
200 case 'e': /* POSIX: pattern list */
213 case 'f': /* POSIX: pattern file */
242 case 'w': /* Solaris: treat pattern as word */
345 * No -e or -f? Make sure there is one more arg, use it as the pattern.
489 * Add a file of strings to the pattern list.
500 * Open the pattern file
549 * Add a string to the pattern list.
570 * Solaris wflag support: Add '<' '>' to pattern to
595 pp->pattern = wordbuf;
616 * need to fix the specified pattern if -x is specified with
627 plen = strlen(pp->pattern);
628 /* '^' pattern '$' */
638 cq = strcpy(cq, pp->pattern) + plen;
641 free(pp->pattern);
642 pp->pattern = cp;
652 n = strlen(pp->pattern) + 1;
660 if (mbstowcs(pp->wpattern, pp->pattern, n) ==
665 cmdname, pp->pattern);
675 free(pp->pattern);
684 for (cp = (unsigned char *)pp->pattern;
701 if ((rv = regcomp(&pp->re, pp->pattern, regflags)) != 0) {
705 cmdname, pp->pattern, errstr);
708 free(pp->pattern);
719 * - only one pattern (npatterns == 1)
720 * - non zero length pattern (strlen(patterns->pattern) != 0)
722 * It's guaranteed patterns->pattern is still alive
726 (npatterns == 1) && (strlen(patterns->pattern) != 0);
793 * The fast one is used when we have a single pattern with
794 * a string known to occur in the pattern. We can then
819 bmgcomp(pp->pattern, strlen(pp->pattern));
937 * pattern. If not, restart from the last line
944 * No pattern found in this chunk.
1066 if (fptr[0] == pp->pattern[0] &&
1067 strcmp(fptr, pp->pattern) == 0) {
1074 if (strstr(fptr, pp->pattern) != NULL) {
1113 * to the pattern.
1228 * Compile literal pattern into BMG tables