fork(1) download
  1. <?php
  2.  
  3. $url = 'http://c...content-available-to-author-only...n.com/d/3542re6s/somthing.html';
  4. $pattern = '#//(?:(?:chris|terry|jack)\.)?mydomain\.com/d/([^/]+)(?|/)#';
  5.  
  6. preg_match($pattern, $url, $matches);
  7. var_dump($matches);
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
array(2) {
  [0]=>
  string(32) "//chris.mydomain.com/d/3542re6s/"
  [1]=>
  string(8) "3542re6s"
}