Sun Java System Web Proxy Server 4.0.11 NSAPI Developer's Guide


The shexp_match function compares a specified prevalidated shell expression against a specified string. The function returns one of three possible values representing match, no match, and invalid comparison. This comparison, in contrast to the comparison made by the shexp_casecmp function, is case sensitive.

The shexp_match function doesn’t perform validation of the shell expression. The function assumes shexp_valid have already been called .

Use this function if you have a shell expression such as * and you want to make sure that a string matches it, such as


int shexp_match(char *str, char *exp);


0 if a match was found.

1 if no match was found.

-1 if the comparison resulted in an invalid expression.


char *str is the string to be compared.

char *exp is the prevalidated shell expression (wildcard pattern) to compare against.

See Also

shexp_casecmp, shexp_cmp, shexp_valid