diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php
index 6c441bac6..c1aca4f6a 100644
--- a/src/Content/Text/BBCode.php
+++ b/src/Content/Text/BBCode.php
@@ -1623,15 +1623,15 @@ class BBCode extends BaseObject
// Try to Oembed
if ($try_oembed) {
- $text = preg_replace("/\[video\](.*?\.(ogg|ogv|oga|ogm|webm|mp4))\[\/video\]/ism", '', $text);
- $text = preg_replace("/\[audio\](.*?\.(ogg|ogv|oga|ogm|webm|mp4|mp3))\[\/audio\]/ism", '', $text);
+ $text = preg_replace("/\[video\](.*?\.(ogg|ogv|oga|ogm|webm|mp4).*?)\[\/video\]/ism", '', $text);
+ $text = preg_replace("/\[audio\](.*?\.(ogg|ogv|oga|ogm|webm|mp4|mp3).*?)\[\/audio\]/ism", '', $text);
$text = preg_replace_callback("/\[video\](.*?)\[\/video\]/ism", $try_oembed_callback, $text);
$text = preg_replace_callback("/\[audio\](.*?)\[\/audio\]/ism", $try_oembed_callback, $text);
} else {
- $text = preg_replace("/\[video\](.*?)\[\/video\]/",
+ $text = preg_replace("/\[video\](.*?)\[\/video\]/ism",
'$1', $text);
- $text = preg_replace("/\[audio\](.*?)\[\/audio\]/",
+ $text = preg_replace("/\[audio\](.*?)\[\/audio\]/ism",
'$1', $text);
}