| 
									
										
										
										
											1997-04-27 21:25:52 +00:00
										 |  |  | \section{Standard Module \sectcode{fnmatch}} | 
					
						
							| 
									
										
										
										
											1997-07-17 16:34:52 +00:00
										 |  |  | \label{module-fnmatch} | 
					
						
							| 
									
										
										
										
											1997-04-27 21:25:52 +00:00
										 |  |  | \stmodindex{fnmatch} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1998-01-11 19:06:37 +00:00
										 |  |  | This module provides support for \UNIX{} shell-style wildcards, which | 
					
						
							|  |  |  | are \emph{not} the same as regular expressions (which are documented | 
					
						
							| 
									
										
										
										
											1998-02-16 21:37:58 +00:00
										 |  |  | in the \module{re}\refstmodindex{re} module).  The special characters | 
					
						
							| 
									
										
										
										
											1998-01-11 19:06:37 +00:00
										 |  |  | used in shell-style wildcards are: | 
					
						
							| 
									
										
										
										
											1998-02-16 21:37:58 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | \begin{list}{}{\leftmargin 0.5in \labelwidth 0.45in} | 
					
						
							| 
									
										
										
										
											1997-04-27 21:25:52 +00:00
										 |  |  | \item[\code{*}] matches everything | 
					
						
							|  |  |  | \item[\code{?}]	matches any single character | 
					
						
							|  |  |  | \item[\code{[}\var{seq}\code{]}] matches any character in \var{seq} | 
					
						
							|  |  |  | \item[\code{[!}\var{seq}\code{]}] matches any character not in \var{seq} | 
					
						
							| 
									
										
										
										
											1998-02-16 21:37:58 +00:00
										 |  |  | \end{list} | 
					
						
							| 
									
										
										
										
											1997-04-27 21:25:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1998-01-11 19:06:37 +00:00
										 |  |  | Note that the filename separator (\code{'/'} on \UNIX{}) is \emph{not} | 
					
						
							|  |  |  | special to this module.  See module \code{glob}\refstmodindex{glob} | 
					
						
							| 
									
										
										
										
											1998-02-16 21:37:58 +00:00
										 |  |  | for pathname expansion (\module{glob} uses \function{fnmatch()} to | 
					
						
							| 
									
										
										
										
											1998-01-11 19:06:37 +00:00
										 |  |  | match filename segments). | 
					
						
							| 
									
										
										
										
											1997-04-27 21:25:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1997-11-30 05:53:22 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1998-01-11 19:06:37 +00:00
										 |  |  | \begin{funcdesc}{fnmatch}{filename, pattern} | 
					
						
							| 
									
										
										
										
											1997-04-27 21:25:52 +00:00
										 |  |  | Test whether the \var{filename} string matches the \var{pattern} | 
					
						
							|  |  |  | string, returning true or false.  If the operating system is | 
					
						
							|  |  |  | case-insensitive, then both parameters will be normalized to all | 
					
						
							|  |  |  | lower- or upper-case before the comparision is performed.  If you | 
					
						
							|  |  |  | require a case-sensitive comparision regardless of whether that's | 
					
						
							| 
									
										
										
										
											1998-02-16 21:37:58 +00:00
										 |  |  | standard for your operating system, use \function{fnmatchcase()} | 
					
						
							|  |  |  | instead. | 
					
						
							| 
									
										
										
										
											1997-04-27 21:25:52 +00:00
										 |  |  | \end{funcdesc} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1998-01-11 19:06:37 +00:00
										 |  |  | \begin{funcdesc}{fnmatchcase}{filename, pattern} | 
					
						
							| 
									
										
										
										
											1997-04-27 21:25:52 +00:00
										 |  |  | Test whether \var{filename} matches \var{pattern}, returning true or | 
					
						
							|  |  |  | false; the comparision is case-sensitive. | 
					
						
							|  |  |  | \end{funcdesc} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1998-01-11 19:06:37 +00:00
										 |  |  | \begin{seealso} | 
					
						
							|  |  |  | \seemodule{glob}{Shell-style path expansion} | 
					
						
							|  |  |  | \end{seealso} |