We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
matches
I came across a surprising matches validator behavior: it marks a value as valid when only part of the value satisfies given regex:
(b/valid? {:name "ab"} {:name [v/required v/string [v/matches #"\w{1,2}"]]}) ;;=> true (b/valid? {:name "abc"} {:name [v/required v/string [v/matches #"\w{1,2}"]]}) ;; should be false ;;=> true (re-matches #"\w{1,2}" "abc") ;;=> nil ;; even worse if we expect only digits (b/valid? {:name "abc123def"} {:name [v/required v/string [v/matches #"\d+"]]}) ;;=> true
Is this an expected behavior?
The text was updated successfully, but these errors were encountered:
Is the expected usage pattern that we should use^ and $?
^
$
(b/valid? {:name "abc123def"} {:name [v/required v/string [v/matches #"^\d+$"]]}) ;;=> false (b/valid? {:name "123"} {:name [v/required v/string [v/matches #"^\d+$"]]}) ;;=> true
Sorry, something went wrong.
No branches or pull requests
I came across a surprising
matches
validator behavior: it marks a value as valid when only part of the value satisfies given regex:Is this an expected behavior?
The text was updated successfully, but these errors were encountered: