diff --git a/GTG/core/urlregex.py b/GTG/core/urlregex.py index 67f41628c..280178836 100644 --- a/GTG/core/urlregex.py +++ b/GTG/core/urlregex.py @@ -28,7 +28,7 @@ UTF_CHARS = r'a-z0-9_\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u00ff' SUBST_DICT = { - "domain": r'([\.-]|[^\s_\!\.\/])+\.[a-z]{2,}(?::[0-9]+)?', + "domain": r'([\.-]|[^\s_\!\.\/])+\.[a-z]{1,}(?::[0-9]+)?', "path": r'(?:[\.,]?[%s!\*\'\(\);:&=\+\$/%s#\[\]\-_,~@])' % ( UTF_CHARS, '%'), "query": r'[a-z0-9!\*\'\(\);:&=\+\$/%#\[\]\-_\.,~]', diff --git a/tests/core/test_urlregex.py b/tests/core/test_urlregex.py index 16ead1f0d..66fc86a6c 100644 --- a/tests/core/test_urlregex.py +++ b/tests/core/test_urlregex.py @@ -25,3 +25,7 @@ def test_search_does_not_include_preceeding_whitespace(self): match = urlregex.search("This snippet contains an url with whitespace" "before it: https://wiki.gnome.org/Apps/GTG/") self.assertEqual(list(match)[0].group(), "https://wiki.gnome.org/Apps/GTG/") + + def test_domain_with_short_suffix(selfs): + match = urlregex.search("https://ticketsystem.company.x/issues/12345") + selfs.assertEqual(list(match)[0].group(), "https://ticketsystem.company.x/issues/12345")