fork(1) download
  1. <?php
  2.  
  3. $ar = array("/Volumes/SAMPLES/ VOCALS/",
  4. "/Volumes/SAMPLES/ VOCALS/ AFRICA/",
  5. "/Volumes/SAMPLES/ VOCALS/ AcmeInc Club Vocals/",
  6. "/Volumes/SAMPLES/ VOCALS/ AtomicInc Dance Vocals/",
  7. "/Volumes/SAMPLES/ VOCALS/ AFRICA/ AfroInc Zulu Vocals/",
  8. "/Volumes/SAMPLES/ VOCALS/ AFRICA/ SampleInc Warriors/",
  9. "/Volumes/SAMPLES/ VOCALS/ AFRICA/ SampleInc Warriors/SampleInc_Warriors_Ululation/",
  10. "/Volumes/SAMPLES/ VOCALS/ AFRICA/ SampleInc Warriors/SampleInc_Warriors_Drums/",
  11. "/Volumes/SAMPLES/ VOCALS/ AFRICA/ AfroInc Zulu Vocals/ Folder1/"
  12. );
  13. $n = preg_grep('~/(?: +[^/\s]+)*/ [^/\s]+(?: +[^/\s]+)*/$~', $ar);
  14. print_r($n);
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
Array
(
    [2] => /Volumes/SAMPLES/  VOCALS/ AcmeInc Club Vocals/
    [3] => /Volumes/SAMPLES/  VOCALS/ AtomicInc Dance Vocals/
    [4] => /Volumes/SAMPLES/  VOCALS/  AFRICA/ AfroInc Zulu Vocals/
    [5] => /Volumes/SAMPLES/  VOCALS/  AFRICA/ SampleInc Warriors/
)