{"id":7394,"date":"2022-12-20T19:37:55","date_gmt":"2022-12-20T22:37:55","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/fnmatch-man3-2\/"},"modified":"2022-12-20T19:37:55","modified_gmt":"2022-12-20T22:37:55","slug":"fnmatch-man3-2","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/fnmatch-man3-2\/","title":{"rendered":"FNMATCH (man3)"},"content":{"rendered":"<h1 align=\"center\">FNMATCH<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#RETURN VALUE\">RETURN VALUE<\/a><br \/> <a href=\"#ATTRIBUTES\">ATTRIBUTES<\/a><br \/> <a href=\"#CONFORMING TO\">CONFORMING TO<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#COLOPHON\">COLOPHON<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">fnmatch \u2212 match filename or pathname<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>#include <fnmatch.h><\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>int fnmatch(const char *<\/b><i>pattern<\/i><b>, const char *<\/b><i>string<\/i><b>, int<\/b> <i>flags<\/i><b>);<\/b><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>fnmatch<\/b>() function checks whether the <i>string<\/i> argument matches the <i>pattern<\/i> argument, which is a shell wildcard pattern (see <b>glob<\/b>(7)).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>flags<\/i> argument modifies the behavior; it is the bitwise OR of zero or more of the following flags: <b><br \/> FNM_NOESCAPE<\/b><\/p>\n<p style=\"margin-left:22%;\">If this flag is set, treat backslash as an ordinary character, instead of an escape character.<\/p>\n<p style=\"margin-left:11%;\"><b>FNM_PATHNAME<\/b><\/p>\n<p style=\"margin-left:22%;\">If this flag is set, match a slash in <i>string<\/i> only with a slash in <i>pattern<\/i> and not by an asterisk (*) or a question mark (?) metacharacter, nor by a bracket expression ([]) containing a slash.<\/p>\n<p style=\"margin-left:11%;\"><b>FNM_PERIOD<\/b><\/p>\n<p style=\"margin-left:22%;\">If this flag is set, a leading period in <i>string<\/i> has to be matched exactly by a period in <i>pattern<\/i>. A period is considered to be leading if it is the first character in <i>string<\/i>, or if both <b>FNM_PATHNAME<\/b> is set and the period immediately follows a slash.<\/p>\n<p style=\"margin-left:11%;\"><b>FNM_FILE_NAME<\/b><\/p>\n<p style=\"margin-left:22%;\">This is a GNU synonym for <b>FNM_PATHNAME<\/b>.<\/p>\n<p style=\"margin-left:11%;\"><b>FNM_LEADING_DIR<\/b><\/p>\n<p style=\"margin-left:22%;\">If this flag (a GNU extension) is set, the pattern is considered to be matched if it matches an initial segment of <i>string<\/i> which is followed by a slash. This flag is mainly for the internal use of glibc and is implemented only in certain cases.<\/p>\n<p style=\"margin-left:11%;\"><b>FNM_CASEFOLD<\/b><\/p>\n<p style=\"margin-left:22%;\">If this flag (a GNU extension) is set, the pattern is matched case-insensitively.<\/p>\n<p style=\"margin-left:11%;\"><b>FNM_EXTMATCH<\/b><\/p>\n<p style=\"margin-left:22%;\">If this flag (a GNU extension) is set, extended patterns are supported, as introduced by \u2019ksh\u2019 and now supported by other shells. The extended format is as follows, with <i>pattern\u2212list<\/i> being a \u2019|\u2019 separated list of patterns.<\/p>\n<p style=\"margin-left:11%;\">\u2019?(<i>pattern\u2212list<\/i>)\u2019<\/p>\n<p style=\"margin-left:22%;\">The pattern matches if zero or one occurrences of any of the patterns in the <i>pattern\u2212list<\/i> match the input <i>string<\/i>.<\/p>\n<p style=\"margin-left:11%;\">\u2019*(<i>pattern\u2212list<\/i>)\u2019<\/p>\n<p style=\"margin-left:22%;\">The pattern matches if zero or more occurrences of any of the patterns in the <i>pattern\u2212list<\/i> match the input <i>string<\/i>.<\/p>\n<p style=\"margin-left:11%;\">\u2019+(<i>pattern\u2212list<\/i>)\u2019<\/p>\n<p style=\"margin-left:22%;\">The pattern matches if one or more occurrences of any of the patterns in the <i>pattern\u2212list<\/i> match the input <i>string<\/i>.<\/p>\n<p style=\"margin-left:11%;\">\u2019@(<i>pattern\u2212list<\/i>)\u2019<\/p>\n<p style=\"margin-left:22%;\">The pattern matches if exactly one occurrence of any of the patterns in the <i>pattern\u2212list<\/i> match the input <i>string<\/i>.<\/p>\n<p style=\"margin-left:11%;\">\u2019!(<i>pattern\u2212list<\/i>)\u2019<\/p>\n<p style=\"margin-left:22%;\">The pattern matches if the input <i>string<\/i> cannot be matched with any of the patterns in the <i>pattern\u2212list<\/i>.<\/p>\n<h2>RETURN VALUE <a name=\"RETURN VALUE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Zero if <i>string<\/i> matches <i>pattern<\/i>, <b>FNM_NOMATCH<\/b> if there is no match or another nonzero value if there is an error.<\/p>\n<h2>ATTRIBUTES <a name=\"ATTRIBUTES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">For an explanation of the terms used in this section, see <b>attributes<\/b>(7).<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"8%\"><\/td>\n<td width=\"7%\"> <\/td>\n<td width=\"8%\"> <\/td>\n<td width=\"8%\"><\/td>\n<td width=\"7%\"><\/td>\n<td width=\"62%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"8%\"><\/td>\n<td width=\"7%\"><\/td>\n<td width=\"8%\"> <\/td>\n<td width=\"8%\"><\/td>\n<td width=\"7%\"><\/td>\n<td width=\"62%\"> <\/td>\n<\/tr>\n<\/table>\n<p align=\"center\"><img decoding=\"async\" src=\"grohtml-1639771.png\" alt=\"Image grohtml-1639771.png\"><\/p>\n<h2>CONFORMING TO <a name=\"CONFORMING TO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">POSIX.1-2001, POSIX.1-2008, POSIX.2. The <b>FNM_FILE_NAME<\/b>, <b>FNM_LEADING_DIR<\/b>, and <b>FNM_CASEFOLD<\/b> flags are GNU extensions.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>sh<\/b>(1), <b>glob<\/b>(3), <b>scandir<\/b>(3), <b>wordexp<\/b>(3), <b>glob<\/b>(7)<\/p>\n<h2>COLOPHON <a name=\"COLOPHON\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This page is part of release 5.10 of the Linux <i>man-pages<\/i> project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https:\/\/www.kernel.org\/doc\/man\u2212pages\/.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  fnmatch \u2212 match filename or pathname <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2536],"tags":[2538,1645,3007],"class_list":["post-7394","post","type-post","status-publish","format-standard","hentry","category-3-llamadas-de-bibliotecas","tag-2538","tag-fnmatch","tag-man3"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7394","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=7394"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7394\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}