fork download
  1. <?php
  2.  
  3. $url1 = 'http://r...content-available-to-author-only...e.ru/video/d5a659aa519c7ee02b369ac858f06251';
  4. $url2 = 'http://r...content-available-to-author-only...e.ru/play/embed/7027220?autoStart=true&bmstart=0&isFullTab=true&ref=window';
  5.  
  6. $urlmatch = '(?:video|play/embed)/(\w+)';
  7. preg_match('~'.$urlmatch.'~', $url1, $match);
  8. print_r($match);
  9. preg_match('~'.$urlmatch.'~', $url2, $match);
  10. print_r($match);
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
Array
(
    [0] => video/d5a659aa519c7ee02b369ac858f06251
    [1] => d5a659aa519c7ee02b369ac858f06251
)
Array
(
    [0] => play/embed/7027220
    [1] => 7027220
)