title: Parse error: syntax error, unexpected '"]([^'"' (T_CONSTANT_ENCAPSED_STRING) on wordpress
body: <p>Getting the error as showed in the title.</p>
  
  <pre><code>/**************************/
  /* Facebook Support      */
  function get_fbimage() {
  global $post;
  if ( !is_single() ){
      return '';
  }
  $src = wp_get_attachment_image_src( get_post_thumbnail_id($post-&gt;ID), '', '' );
  $fbimage = null;
  if ( has_post_thumbnail($post-&gt;ID) ) {
      $fbimage = $src[0];
  } else {
      global $post, $posts;
      $fbimage = '';
      $output = preg_match_all('/&lt;img.+src=[\'"]([^\'"]+)[\'"].*&gt;/i',
      $post-&gt;post_content, $matches);
      if(!empty($matches[1]))
          $fbimage = $matches [1] [0];
  }
  if(empty($fbimage)) {
      $fbimage = get_the_post_thumbnail($post-&gt;ID);
  }
  return $fbimage;
  }
  
  add_action( 'woocommerce_after_shop_loop_item', 'remove_add_to_cart_buttons', 1 );
  
  function remove_add_to_cart_buttons() {
    if( is_product_category() || is_shop()) { 
      remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' );
    }
  }
  
  /**************************/
  </code></pre>
  
  <p>The page says the error is on line 158 which is here:</p>
  
  <pre><code>...
  $output = preg_match_all('/&lt;img.+src=[\'"]([^\'"]+)[\'"].*&gt;/i',
  ...
  </code></pre>
  
  <p>What is going wrong?</p>