Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(🎁) Inspect input strings that have regex validators #907

Open
KotlinIsland opened this issue Mar 25, 2024 · 0 comments
Open

(🎁) Inspect input strings that have regex validators #907

KotlinIsland opened this issue Mar 25, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@KotlinIsland
Copy link
Contributor

from re import Pattern

from pydantic import BaseModel, Field, validate_call


class A(BaseModel):
    a: str = Field(regex=r"\d")


A(a="a")  # no errror


@validate_call
def f(a: str = Field(regex=r"\d")):
    print(a)


f("a")  # no errror
@koxudaxi koxudaxi added the enhancement New feature or request label Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants