3 .ds ;G \\*(;G\\f\\$1\\$3\\f\\$2
4 .if !
\a\\$4
\a\a .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
7 .ie
\a\\$3
\a\a .ft \\$1
11 .Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
16 .aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
19 .aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
22 .aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
24 .de EX \" start example
41 strmatch \- match shell file patterns
43 .L "int strmatch(char* s, char* p)"
45 .L "char* submatch(char* s, char* p, int m)"
50 with the shell pattern
52 and returns 1 for match and 0 otherwise.
54 does a leading substring match of the shell pattern
60 is 0 then the match is minimal, otherwise a maximal match is done.
61 A pointer to the first character after the matched substring is returned,
69 each shell pattern has an equivalent
73 \fBsh pattern egrep RE description\fP
77 [!.] [^.] negated char class
78 *(.) (.)* 0 or more of
79 +(.) (.)+ 1 or more of
88 is used to escape *, ?, (, |, &, ), [, and \e
95 terminates the top level pattern.
101 constructs are non-intuitive and are computationally intensive.