PHP Regex在WP Caption中获取img

I want to get the img tag inside the caption tag

Example:

[caption id="attachment_5433" align="aligncenter" width="413"]
    <a href="abc.jpg"><img class=" wp-image-5433" title="This is a title" src="abc.jpg" alt="This is alt" width="413" height="551"></a>This is a desc
[/caption]

and the result:

<img class=" wp-image-5433" title="This is a title" src="abc.jpg" alt="This is alt" width="413" height="551">

How to do it by PHP regex?

<?php
    $string = '[caption id="attachment_5433" align="aligncenter" width="413"]
    <a href="abc.jpg"><img class=" wp-image-5433" title="This is a title" src="abc.jpg" alt="This is alt" width="413" height="551"></a>This is a desc
[/caption]';

    $result = preg_match_all("/\[caption.*?].*?(<img.*?\/?>).*?\[\/caption]/s", $string, $matches);

    print_r($matches);
?>

Ouput

Array
(
    [0] : Array
        (
            [0] : '[caption id="attachment_5433" align="aligncenter" width="413"]
    <a href="abc.jpg"><img class=" wp-image-5433" title="This is a title" src="abc.jpg" alt="This is alt" width="413" height="551"></a>This is a desc
[/caption]'
        )

    [1] : Array
        (
            [0] : '<img class=" wp-image-5433" title="This is a title" src="abc.jpg" alt="This is alt" width="413" height="551">'
        )

)

Update, with replace callback

<?php
    $string = '[caption id="attachment_5433" align="aligncenter" width="413"]
    <a href="abc.jpg"><img class=" wp-image-5433" title="This is a title" src="abc.jpg" alt="This is alt" width="413" height="551"></a>This is a desc
[/caption]';

    echo preg_replace_callback('/\[caption.*?].*?(<img.*?\/?>).*?\[\/caption]/s', function($matches) {
        return $matches[1];
    }, $string);
?>
preg_match_all('/\[caption.*?\].*?(\<img[^>]*?).*?\[\/caption\]/', $stringWhereToSearchImg, $matches);

matches will have img tag.

By the way you don't have ending that for img you should end it with />