Issue fetching Youtube link from post content

I’m using the following code to track and extract Youtube links from posts content:

<?php $entry_content = apply_filters( 'the_content', get_the_content() );
  if ( preg_match('%(?:youtube(?:-nocookie)?.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu.be/)([^"&?/ ]{11})%i', $entry_content, $matches) ) { ?>
    <iframe width="300" height="300" src="https://www.<?php echo $matches[0]; ?>" frameborder="0" allowfullscreen>
    </iframe>
<?php } ?>

It works fine except for this issue: if the paragraph after the Youtube link starts with a double quotation mark, the code breaks, displaying the following right after the video (in the frontend): “Ab" frameborder="0" allowfullscreen> (being ‘Ab’ the first two characters of the mentioned paragraph).

Read More

What could be causing this problem? :S

Related posts