fork download
  1. $input = <<<XYZ
  2. <a href = "http://www.example.com/roger/that"> </a> => not extracted
  3. <a href="http://www.example.com/roger/view/that"</a> => extracted
  4. XYZ;
  5.  
  6. $pattern = '/\<a href(.*?\/view\/.*?)<\/a>/';
  7. preg_match_all($pattern, $input, $matches);
  8. print_r($matches);
Success #stdin #stdout 0.02s 13112KB
stdin
Standard input is empty
stdout
$input = <<<XYZ
<a href = "http://www.example.com/roger/that"> </a> => not extracted
<a href="http://www.example.com/roger/view/that"</a>  => extracted
XYZ;

$pattern = '/\<a href(.*?\/view\/.*?)<\/a>/';
preg_match_all($pattern, $input, $matches);
print_r($matches);