from pydantic import BaseModel, constr DepartmentIDRegex = constr(regex=r"^D\d{3}$") class DepartmentCreateSchema(BaseModel): name: str