diff --git a/eventsourcing/examples/test_parking_lot.py b/eventsourcing/examples/test_parking_lot.py
index <HASH>..<HASH> 100644
--- a/eventsourcing/examples/test_parking_lot.py
+++ b/eventsourcing/examples/test_parking_lot.py
@@ -17,10 +17,10 @@ from eventsourcing.system import NotificationLogReader
 @dataclass
 class LicencePlate:
     number: str
+    regex = re.compile("^[0-9]{3}-[0-9]{3}$")
 
     def __post_init__(self) -> None:
-        regex = re.compile("^[0-9]{3}-[0-9]{3}$")
-        if not bool(regex.match(self.number)):
+        if not bool(self.regex.match(self.number)):
             raise ValueError()
Moved regex to be a class attribute.