SPL-StandardPHPLibrary
findregex.php
Go to the documentation of this file.
1 <?php
2 
15 if ($argc < 3) {
16  echo <<<EOF
17 Usage: php findregex.php <file> <name>
18 
19 Find a specific file by name.
20 
21 <path> Path to search in.
22 <name> Regex for filenames to look for.
23 
24 
25 EOF;
26  exit(1);
27 }
28 
29 if (!class_exists("RegexFindFile", false)) require_once("regexfindfile.inc");
30 
31 foreach(new RegexFindFile($argv[1], $argv[2]) as $file)
32 {
33  echo $file->getPathname()."\n";
34 }
35 
36 ?>
Find files by regular expression.