diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp
index 5d2d5a68dc0ffb6c71e9a227fae0390a10f39fe1..d77e4409d4026998e421e8a7d08840a97cef1571 100644
--- a/src/timeline/TimelineModel.cpp
+++ b/src/timeline/TimelineModel.cpp
@@ -534,7 +534,7 @@ TimelineModel::data(const mtx::events::collections::TimelineEvents &event, int r
                 formattedBody_.replace(matchImgUri, "\\1 src=\"image://mxcImage/\\2\"\\3");
                 // Same regex but for single quotes around the src
                 const static QRegularExpression matchImgUri2(
-                                                            "(<img [^>]*)src=\'mxc://([^\"]*)\'([^>]*>)");
+                                                            "(<img [^>]*)src=\'mxc://([^\']*)\'([^>]*>)");
                 formattedBody_.replace(matchImgUri2, "\\1 src=\"image://mxcImage/\\2\"\\3");
                 const static QRegularExpression matchEmoticonHeight(
                   "(<img data-mx-emoticon [^>]*)height=\"([^\"]*)\"([^>]*>)");