1
/****************************************************************************
5
This file contains the C code for the regular expression
8
The routines supported act as a more friendly, user level
9
interface to the regexp regular expression matching system.
11
****************************************************************************/
16
* Department of Computer Science
17
* University Of Illinois at Urbana-Champaign
18
* 1304 West Springfield Avenue
28
void RegExpCompile(regexp,fsm_ptr)
32
regcomp(fsm_ptr, regexp, REG_NOSUB|REG_EXTENDED);
34
compile(regexp,fsm_ptr,&(fsm_ptr[fsm_length]),'\0');
36
} /* End RegExpCompile */
39
int RegExpMatch(string,fsm_ptr)
43
if (regexec(fsm_ptr, string, 0, NULL, 0) == 0)
47
if (advance(string,fsm_ptr) != 0)
52
} /* End RegExpMatch */
55
void _RegExpError(val)
58
fprintf(stderr,"Regular Expression Error %d\n",val);
60
} /* End _RegExpError */
63
void RegExpPatternToRegExp(pattern,reg_exp)
64
char *pattern,*reg_exp;
69
while (*pattern != '\0')
73
if (*pattern == ']') in_bracket = 0;
74
*reg_exp++ = *pattern++;
96
*reg_exp++ = *pattern;
104
} /* End RegExpPatternToRegExp */