diff --git a/api/src/Html.php b/api/src/Html.php
index 9c8d132d45..4cca2218a9 100644
--- a/api/src/Html.php
+++ b/api/src/Html.php
@@ -61,7 +61,7 @@ class Html
{
// First match things beginning with http:// (or other protocols)
$Protocol = '(http:\/\/|(ftp:\/\/|https:\/\/))'; // only http:// gets removed, other protocolls are shown
- $Domain = '([\w-]+\.[\w-.]+)';
+ $Domain = '([\w-]+\.[\w\-.]+)';
$Subdir = '([\w\-\.,@?^=%&;:\/~\+#]*[\w\-\@?^=%&\/~\+#])?';
$optStuff = '("|"|;)?';
$Expr = '/' . $NotAnchor . $Protocol . $Domain . $Subdir . $optStuff . '/i';
@@ -92,7 +92,7 @@ class Html
// Now match things beginning with www.
$optBracket0 = '(<|<)?';
$NotHTTP = '(?)'; // avoid running again on http://www links already handled above
- $Domain2 = 'www(\.[\w-.]+)';
+ $Domain2 = 'www(\.[\w\-.]+)';
$Subdir2 = '([\w\-\.,@?^=%&:\/~\+#]*[\w\-\@?^=%&\/~\+#])?';
$optBracket = '(>|>|>|;)?';
$Expr = '/' .$optBracket0. $NotAnchor . $NotHTTP . $Domain2 . $Subdir2 .$optBracket. '/i';