diff --git a/fastjsonschema/draft04.py b/fastjsonschema/draft04.py
index 6d79a1e..57b2a85 100644
--- a/fastjsonschema/draft04.py
+++ b/fastjsonschema/draft04.py
@@ -20,10 +20,7 @@ class CodeGeneratorDraft04(CodeGenerator):
     FORMAT_REGEXS = {
         'date-time': r'^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:[+-][0-2]\d:[0-5]\d|Z)?$',
         'email': r'^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$',
-        'hostname': (
-            r'^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*'
-            r'([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]{1,62}[A-Za-z0-9])$'
-        ),
+        'hostname': r'^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]{0,61}[A-Za-z0-9])$',
         'ipv4': r'^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$',
         'ipv6': r'^(?:(?:[0-9A-Fa-f]{1,4}:){6}(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|(?:(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::(?:[0-9A-Fa-f]{1,4}:){5}(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|(?:(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(?:[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1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1,4}|(?:(?:[0-9A-Fa-f]{1,4}:){,6}[0-9A-Fa-f]{1,4})?::)$',
         'uri': r'^\w+:(\/?\/?)[^\s]+$',

'example.de' (and many others hostnames) not valid with hostname format 
Aaand another one. Hope you aren't getting annoyed. Running this example throws a JsonSchemaException:

```
import fastjsonschema

schema = {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "https://example.com/example.schema.json",
    "title": "Example",
    "description": "An example schema",
    "type": "object",
    "properties": {
        "host": {
            "type": "string",
            "description": "Some hostname",
            "format": "hostname"
        }   
    }
}

validate = fastjsonschema.compile(schema)

validate({"host": "example.de"})
```

For 'google.com' it works fine. I'll create a PR soon, probably.
diff --git a/tests/test_datetime.py b/tests/test_datetime.py
index 2263e9f..b9e460b 100644
--- a/tests/test_datetime.py
+++ b/tests/test_datetime.py
@@ -1,4 +1,3 @@
-
 import pytest
 
 from fastjsonschema import JsonSchemaException
diff --git a/tests/test_hostname.py b/tests/test_hostname.py
new file mode 100644
index 0000000..8620ed1
--- /dev/null
+++ b/tests/test_hostname.py
@@ -0,0 +1,19 @@
+import pytest
+
+from fastjsonschema import JsonSchemaException
+
+
+exc = JsonSchemaException('data must be hostname')
+@pytest.mark.parametrize('value, expected', [
+    ('', exc),
+    ('LDhsjf878&d', exc),
+    ('bla.bla-', exc),
+    ('example.example.com-', exc),
+    ('localhost', 'localhost'),
+    ('example.com', 'example.com'),
+    ('example.de', 'example.de'),
+    ('example.fr', 'example.fr'),
+    ('example.example.com', 'example.example.com'),
+])
+def test_hostname(asserter, value, expected):
+    asserter({'type': 'string', 'format': 'hostname'}, value, expected)

pip install -e .[devel]
parse_log_pytest
pytest
pytest pytest-benchmark
apt-get update apt-get install -y gcc
3.6
requirements/base.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
astroid==2.11.7
attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work
certifi==2021.5.30
charset-normalizer==2.0.12
colorama==0.4.5
dill==0.3.4
execnet==1.9.0
-e git+https://github.com/horejsek/python-fastjsonschema.git@6c07d2300c5018628dab9487bd5a89b85acb3084#egg=fastjsonschema
idna==3.10
importlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
isort==5.10.1
json-spec==0.10.1
jsonschema==3.2.0
lazy-object-proxy==1.7.1
mccabe==0.7.0
more-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work
packaging @ file:///tmp/build/80754af9/packaging_1637314298585/work
platformdirs==2.4.0
pluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work
py @ file:///opt/conda/conda-bld/py_1644396412707/work
py-cpuinfo==9.0.0
pylint==2.13.9
pyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work
pyrsistent==0.18.0
pytest==6.2.4
pytest-benchmark==3.4.1
pytest-cache==1.0
requests==2.27.1
six==1.17.0
toml @ file:///tmp/build/80754af9/toml_1616166611790/work
tomli==1.2.3
typed-ast==1.5.5
typing_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work
urllib3==1.26.20
validictory==1.1.3
wrapt==1.16.0
zipp @ file:///tmp/build/80754af9/zipp_1633618647012/work

name: python-fastjsonschema
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=21.4.0=pyhd3eb1b0_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - importlib-metadata=4.8.1=py36h06a4308_0
  - importlib_metadata=4.8.1=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - more-itertools=8.12.0=pyhd3eb1b0_0
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=21.3=pyhd3eb1b0_0
  - pip=21.2.2=py36h06a4308_0
  - pluggy=0.13.1=py36h06a4308_0
  - py=1.11.0=pyhd3eb1b0_0
  - pyparsing=3.0.4=pyhd3eb1b0_0
  - pytest=6.2.4=py36h06a4308_2
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - toml=0.10.2=pyhd3eb1b0_0
  - typing_extensions=4.1.1=pyh06a4308_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.6.0=pyhd3eb1b0_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - astroid==2.11.7
      - charset-normalizer==2.0.12
      - colorama==0.4.5
      - dill==0.3.4
      - execnet==1.9.0
      - idna==3.10
      - isort==5.10.1
      - json-spec==0.10.1
      - jsonschema==3.2.0
      - lazy-object-proxy==1.7.1
      - mccabe==0.7.0
      - platformdirs==2.4.0
      - py-cpuinfo==9.0.0
      - pylint==2.13.9
      - pyrsistent==0.18.0
      - pytest-benchmark==3.4.1
      - pytest-cache==1.0
      - requests==2.27.1
      - six==1.17.0
      - tomli==1.2.3
      - typed-ast==1.5.5
      - urllib3==1.26.20
      - validictory==1.1.3
      - wrapt==1.16.0
prefix: /opt/conda/envs/python-fastjsonschema

tests/test_hostname.py::test_hostname[example.de-example.de] tests/test_hostname.py::test_hostname[example.fr-example.fr]
tests/test_datetime.py::test_datetime[-expected0] tests/test_datetime.py::test_datetime[bla-expected1] tests/test_datetime.py::test_datetime[2018-02-05T14:17:10.00Z-2018-02-05T14:17:10.00Z] tests/test_datetime.py::test_datetime[2018-02-05T14:17:10Z-2018-02-05T14:17:10Z] tests/test_hostname.py::test_hostname[-expected0] tests/test_hostname.py::test_hostname[LDhsjf878&d-expected1] tests/test_hostname.py::test_hostname[bla.bla--expected2] tests/test_hostname.py::test_hostname[example.example.com--expected3] tests/test_hostname.py::test_hostname[localhost-localhost] tests/test_hostname.py::test_hostname[example.com-example.com] tests/test_hostname.py::test_hostname[example.example.com-example.example.com]
fastjsonschema/draft04.py
fastjsonschema/draft04.py