title: Double Quotes not matching in (Cake)PHP Regex
body: <p>I have a regular expression that should be matching some string of the form: src="/blkjad.dafsdf">. It looks like this: (src|href)(\s*)?=(\s*)?(\"|\')/([^/].*?)\4. </p>
  
  <p>While this works fine on one site I'm running, it fails consistently on another, built in Cake. Here's another failing Regex => '/(")/' which should be matching any double quotation in the line. </p>
  
  <p>I'm at a loss right now. One of the senior developers where I work just took a look at it and basically shook his head. Unfortunately, I'm not that proficient with Cake, and I can't seem to find any similar problems online. Any ideas?</p>
  
  <p>edit: For the record, the failing regex uses preg_match_all, while the other (identical/ working regex) uses preg_replace. Here is some relevant code.</p>
  
  <pre><code>$regex['php'] = '/(src|href)(\s*)?=(\s*)?(\"|\')\/([^\/].*?)\4/';
  
  $php = htmlspecialchars(file_get_contents(sprintf('/home/x/x/x/x/x/%s.%s', $string,    $extension)));                                                  echo $php;
  
   if (preg_match_all($regex['php'], $php, $out)){
      echo sizeof($out);
      echo nl2br(print_r($out, true));
   } else {
      echo 'Doesn\'t work';
   }
  </code></pre>