41 const char *
re_cmp(
const char *,
const char *);
68 const char *
re_cmp(
const char *
str,
const char *regexp) {
69 const char *next_regexp;
77 if (regexp == NULL ||
str == NULL)
97 if (matched && *next_regexp == 0)
106 if (matched ==
False)
111 if (matched ==
False)
119 if (matched ==
False)
166 else if (*(
str+1) != 0)
190 const char *next_regexp;
210 if (next_regexp == NULL) {
304 return (
c >= sel->
u.
range.low && c <= sel->u.range.high);
313 return (c < sel->u.range.low &&
c > sel->
u.
range.high);
332 # define exit_if_null if (*regexp == 0) return NULL
334 # define exit_if_null
340 if (sel == NULL || regexp == NULL || *regexp == 0)
345 looking_at = *regexp++;
346 switch (looking_at) {
377 uchar first, last = 0;
380 looking_at = *regexp++;
382 if (looking_at ==
'^') {
385 looking_at = *regexp++;
389 looking_at = *regexp++;
390 if (looking_at ==
']') {
395 }
else if (looking_at ==
'-') {
409 looking_at = *regexp++;
410 if (looking_at ==
']') {
440 for (i = first; i <= last; i++) {
445 sel->
u.
array[first] = !neg;
447 sel->
u.
array[looking_at] = !neg;
451 looking_at = *regexp++;
459 while (looking_at !=
']') {
460 if (looking_at ==
'-') {
462 looking_at = *regexp++;
463 if (looking_at !=
']') {
468 for (i =
previous+1; i < looking_at; i++) {
480 sel->
u.
array[looking_at] = !neg;
483 looking_at = *regexp++;
507 if (*regexp ==
'*') {
510 }
else if (*regexp ==
'?') {
513 }
else if (*regexp ==
'+') {