* [PATCH] fnmatch.3: Describe the FNM_EXTMATCH flag and pattern syntax
@ 2015-10-15 8:58 Pádraig Brady
[not found] ` <1444899508-24394-1-git-send-email-P-V8g9lnOeT5ydJdNcDFJN0w@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Pádraig Brady @ 2015-10-15 8:58 UTC (permalink / raw)
To: mtk.manpages; +Cc: linux-man, libc-alpha, Pádraig Brady
Signed-off-by: Pádraig Brady <P@draigBrady.com>
---
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
--
2.5.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fnmatch.3: Describe the FNM_EXTMATCH flag and pattern syntax
[not found] ` <1444899508-24394-1-git-send-email-P-V8g9lnOeT5ydJdNcDFJN0w@public.gmane.org>
@ 2015-12-27 16:15 ` Michael Kerrisk (man-pages)
0 siblings, 0 replies; 2+ messages in thread
From: Michael Kerrisk (man-pages) @ 2015-12-27 16:15 UTC (permalink / raw)
To: Pádraig Brady
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
linux-man-u79uwXL29TY76Z2rM5mHXA,
libc-alpha-9JcytcrH/bA+uJoB2kUjGw
On 10/15/2015 10:58 AM, Pádraig Brady wrote:
> Signed-off-by: Pádraig Brady <P@draigBrady.com>
Thanks, Pádraig. APplied.
Cheers,
Michael
> ---
> 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
>
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-12-27 16:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-15 8:58 [PATCH] fnmatch.3: Describe the FNM_EXTMATCH flag and pattern syntax Pádraig Brady
[not found] ` <1444899508-24394-1-git-send-email-P-V8g9lnOeT5ydJdNcDFJN0w@public.gmane.org>
2015-12-27 16:15 ` Michael Kerrisk (man-pages)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).