diff --git a/index.php b/index.php
index 207b42b..351d3da 100644
--- a/index.php
+++ b/index.php
@@ -285,7 +285,7 @@
if(!empty($row['comment'])) {
$comment = $row['comment'];
$comment = preg_replace('/^>(?!>\d).+/m', '$0', $comment);
- $comment = preg_replace('/(?:https?|mailto|tel|ftp):[^\s,]+/m', '$0', $comment);
+ $comment = preg_replace('/(?:https?|mailto|tel|ftp):.+?(?=\s|,|<|<|$)/m', '$0', $comment);
$comment = preg_replace_callback('/>>\s*(\d+)/', 'quote_link', $comment);
$comment = str_replace("\n", "
", $comment);
echo "