mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 02:51:37 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			28 lines
		
	
	
		
			567 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			567 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
| Program Example69;
 | |
| 
 | |
| { Program to demonstrate the FNMatch function. }
 | |
| 
 | |
| Uses linux;
 | |
| 
 | |
|   Procedure TestMatch(Pattern,Name : String);
 | |
|   
 | |
|   begin
 | |
|     Write ('"',Name,'" ');
 | |
|     If FNMatch (Pattern,Name) then
 | |
|       Write ('matches')
 | |
|     else
 | |
|       Write ('does not match');
 | |
|     Writeln(' "',Pattern,'".');
 | |
|   end;
 | |
|   
 | |
| begin
 | |
|   TestMatch('*','FileName');
 | |
|   TestMatch('.*','FileName');
 | |
|   TestMatch('*a*','FileName');
 | |
|   TestMatch('?ile*','FileName');
 | |
|   TestMatch('?','FileName');
 | |
|   TestMatch('.?','FileName');
 | |
|   TestMatch('?a*','FileName');
 | |
|   TestMatch('??*me?','FileName');
 | |
| end.
 | 
