da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ds ;G \\*(;G\\f\\$1\\$3\\f\\$2
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.if !\\$4 .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ie \\$3 .ft \\$1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.nr ;G \\n(.f
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ft \\n(;G \}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.de EX \" start example
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ta 1i 2i 3i 4i 5i 6i
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.de EE \" end example
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.TH STRMATCH 3
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinstrmatch \- match shell file patterns
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.SH SYNOPSIS
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L "int strmatch(char* s, char* p)"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L "char* submatch(char* s, char* p, int m)"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.SH DESCRIPTION
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.I strmatch
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincompares the string
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinwith the shell pattern
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinand returns 1 for match and 0 otherwise.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.I submatch
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindoes a leading substring match of the shell pattern
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinwith the string
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis 0 then the match is minimal, otherwise a maximal match is done.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinA pointer to the first character after the matched substring is returned,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinif there is no match.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chineach shell pattern has an equivalent
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.IR egrep (1)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin \fBsh pattern egrep RE description\fP
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * .* 0 or more chars
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ? . any single char
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin [.] [.] char class
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin [!.] [^.] negated char class
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *(.) (.)* 0 or more of
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin +(.) (.)+ 1 or more of
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ?(.) (.)? 0 or 1 of
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin (.) (.) 1 of
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin @(.) (.) 1 of
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin a|b a|b a or b
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin a&b a and b
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin !(.) none of
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis used to escape *, ?, (, |, &, ), [, and \e
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinoutside of [...].
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.SH "SEE ALSO"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinAn unbalanced
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinterminates the top level pattern.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinconstructs are non-intuitive and are computationally intensive.