From patchwork Thu Oct 15 08:58:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?P=C3=A1draig_Brady?=
X-Patchwork-Id: 9160
Received: (qmail 94446 invoked by alias); 15 Oct 2015 08:58:46 -0000
Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm
Precedence: bulk
List-Id:
To: mtk.manpages@gmail.com
Cc: linux-man@vger.kernel.org, libc-alpha@sourceware.org,
=?UTF-8?q?P=C3=A1draig=20Brady?=
Subject: [PATCH] fnmatch.3: Describe the FNM_EXTMATCH flag and pattern syntax
Date: Thu, 15 Oct 2015 09:58:28 +0100
Message-Id: <1444899508-24394-1-git-send-email-P@draigBrady.com>
MIME-Version: 1.0
Signed-off-by: Pádraig Brady
---
man3/fnmatch.3 | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/man3/fnmatch.3 b/man3/fnmatch.3
index a7c55ff..3502e06 100644
--- a/man3/fnmatch.3
+++ b/man3/fnmatch.3
@@ -86,6 +86,32 @@ use of glibc and is implemented only in certain cases.
.B FNM_CASEFOLD
If this flag (a GNU extension) is set, the pattern is matched
case-insensitively.
+.TP
+.B FNM_EXTMATCH
+If this flag (a GNU extension) is set, extended patterns are
+supported, as introduced by \&'ksh' and now supported by other shells.
+The extended format is as follows, with \fIpattern\-list\fR
+being a \&'|' separated list of patterns.
+.TP
+\&'?(\fIpattern\-list\fR)'
+The pattern matches if zero or one occurrences of any of the
+patterns in the \fIpattern\-list\fR match the input \fIstring\fR.
+.TP
+\&'*(\fIpattern\-list\fR)'
+The pattern matches if zero or more occurrences of any of the
+patterns in the \fIpattern\-list\fR match the input \fIstring\fR.
+.TP
+\&'+(\fIpattern\-list\fR)'
+The pattern matches if one or more occurrences of any of the
+patterns in the \fIpattern\-list\fR match the input \fIstring\fR.
+.TP
+\&'@(\fIpattern\-list\fR)'
+The pattern matches if exactly one occurrence of any of the
+patterns in the \fIpattern\-list\fR match the input \fIstring\fR.
+.TP
+\&'!(\fIpattern\-list\fR)'
+The pattern matches if the input \fIstring\fR cannot be matched with
+any of the patterns in the \fIpattern\-list\fR.
.SH RETURN VALUE
Zero if
.I string