  http://.com
  http://invalid-.com
  http://-invalid.com
  http://invalid.com-
  http://invalid.c-m
  http://inv-.alid-.com
  http://inv-.-alid.com
  file://localhost/path
  git://example.com/
  http://.
 
</s> remove     tld_re = r'\.(?:[a-z' + ul + r']{2,63}|xn--[a-z0-9]{1,59})\.?'
 </s> add     tld_re = (
        '\.'                                # dot
        '(?!-)'                             # can't start with a dash
        '(?:[a-z' + ul + '-]{2,63}'         # domain label
        '|xn--[a-z0-9]{1,59})'              # or punycode label
        '(?<!-)'                            # can't end with a dash
        '\.?'                               # may have a trailing dot
    )
http://invalid.-com
  http://.com
  http://invalid-.com
  http://-invalid.com
  http://invalid.com-
http://invalid.-com
  http://inv-.alid-.com
  http://inv-.-alid.com
  file://localhost/path
  git://example.com/
  http://.
keep keep keep keep replace keep keep keep keep keep
 Fixed #26204 -- Reallowed dashes in top-level domains for URLValidator.

Thanks Shai Berger for the review. 
tests/validators/invalid_urls.txt