Lines Matching refs:pattern

820  *	See if a particular string matches a particular pattern.
823 * The return value is 1 if string matches pattern, and
825 * special characters in the pattern: *?\[] (see the manual
835 Tcl_StringMatch(string, pattern)
837 register char *pattern; /* Pattern, which may contain
843 /* See if we're at the end of both the pattern and the string.
844 * If so, we succeeded. If we're at the end of the pattern
848 if (*pattern == 0) {
855 if ((*string == 0) && (*pattern != '*')) {
859 /* Check for a "*" as the next pattern character. It matches
865 if (*pattern == '*') {
866 pattern += 1;
867 if (*pattern == 0) {
871 if (Tcl_StringMatch(string, pattern)) {
881 /* Check for a "?" as the next pattern character. It matches
885 if (*pattern == '?') {
889 /* Check for a "[" as the next pattern character. It is followed
894 if (*pattern == '[') {
895 pattern += 1;
897 if ((*pattern == ']') || (*pattern == 0)) {
900 if (*pattern == *string) {
903 if (pattern[1] == '-') {
904 c2 = pattern[2];
908 if ((*pattern <= *string) && (c2 >= *string)) {
911 if ((*pattern >= *string) && (c2 <= *string)) {
914 pattern += 2;
916 pattern += 1;
918 while (*pattern != ']') {
919 if (*pattern == 0) {
920 pattern--;
923 pattern += 1;
928 /* If the next pattern character is '/', just strip off the '/'
932 if (*pattern == '\\') {
933 pattern += 1;
934 if (*pattern == 0) {
943 if (*pattern != *string) {
947 thisCharOK: pattern += 1;
1376 * while compiling the pattern, then NULL is returned and an error
1402 * Move the matched pattern to the first slot in the
1434 "couldn't compile regular expression pattern: ",
1555 * Otherwise the return value is 1 if "string" matches "pattern"
1565 Tcl_RegExpMatch(interp, string, pattern)
1568 char *pattern; /* Regular expression to match against
1573 re = Tcl_RegExpCompile(interp, pattern);