fork download
  1. <?php
  2.  
  3. $match = [];
  4. $subject = 'http://w...content-available-to-author-only...e.com/highlights/cat/all-about-clothing/';
  5. $pattern = '/http:\/\/www\.example\.com\/highlights\/cat\/(.*)/';
  6. preg_match($pattern, $subject, $match);
  7. print_r($match);
Success #stdin #stdout 0.02s 52480KB
stdin
Standard input is empty
stdout
Array
(
    [0] => http://w...content-available-to-author-only...e.com/highlights/cat/all-about-clothing/
    [1] => all-about-clothing/
)