.\" @str_qsplit
.\" @str_getword
.\" @str_split
+.\" @str_matchx
.\" @str_match
.\" @str_sanitize
.SH SYNOPSIS
.BI " char **" rest ", unsigned " f );
.BI "char *str_getword(char **" pp );
.BI "size_t str_split(char *" p ", char *" v "[], size_t " c ", char **" rest );
+.BI "int str_matchx(const char *" p ", const char *" s ", unsigned " f );
.BI "int str_match(const char *" p ", const char *" s );
.BI "void str_sanitize(char *" d ", const char *" p ", size_t " sz );
.fi
flags words of zero.
.PP
The
-.B str_match
+.B str_matchx
function does simple wildcard matching. The first argument is a
pattern, which may contain metacharacters:
.RB ` * '
.I p
matches the given string
.IR s ,
-or zero if the pattern doesn't match.
+or zero if the pattern doesn't match. If the flag
+.B STRF_PREFIX
+is passed,
+.B str_matchx
+returns true if it reaches the end of the target string before finding a
+mismatch \(en i.e., if the target string is a prefix of a string which
+might match the pattern. The function
+.B str_match
+is a convenient wrapper for
+.B str_matchx
+with a zero flags word, which is the normal case.
.PP
The function
.B str_sanitize