I use in Python the package pydantic and the linker Flake8. I want to use constr from pydantic with a regular Experssion. Only certain Characters should be passed. (a-z, A-Z, 0-9 and _)
The regular Experssion "^[a-zA-Z0-9_]*$"
works, but flake8 shows me the following error:
syntax error in forward annotation '^[a-zA-Z0-9_]*$' flake8(F722)
class RedisSettings(BaseModel):
keyInput: constr(regex="^[a-zA-Z0-9_]*$") = ""
keyOutput: constr(regex="^[a-zA-Z0-9_]*$") = ""
Can you help me to avoid the Error Message?