Ok here you go:
/\[(\d{11}|\w{10})(?:\s*"([^"]+)")?\]\/
Lets say you have this content:
Simple testing [13927101801 "Caption"] [mqEqHAC3rK "caption"]Simple testing Simple testing Simple testinga Simple testing Simple testinga Simple testing Simple testinga [13927101801]
Then you could do this:
$content = do_shortcode(get_the_content());
preg_match_all('/\[(\d{11}|\w{10})(?:\s*"([^"]+)")?\]\/', $content, $matches);
$matches = array_slice($matches, 1);
$matches = call_user_func_array( 'array_map', array_merge(array(NULL), $matches) );
var_dump($matches);
Output:
array (size=3)
0 =>
array (size=2)
0 => string '13927101801' (length=11) // <-- ID
1 => string 'Caption' (length=7) // <-- Caption content
1 =>
array (size=2)
0 => string 'mqEqHAC3rK' (length=10) // <-- ID
1 => string 'caption' (length=7) // <-- Caption content
2 =>
array (size=2)
0 => string '13927101801' (length=11) // <-- ID
1 => string '' (length=0) // <-- No Caption content
And you will get the array of id
and (Optional) caption