We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 32b9b3b commit 12152f2Copy full SHA for 12152f2
lib/helper/extra.ex
@@ -61,6 +61,20 @@ defmodule MishkaDeveloperTools.Helper.Extra do
61
62
def validated_user?(_username), do: false
63
64
+ def validated_password?(password) when is_binary(password) do
65
+ regex_pattern = ~r/^[0-9A-Za-z@#$%^_\-!(,)*]{9,130}$/
66
+
67
+ Enum.all?([
68
+ Regex.match?(regex_pattern, password),
69
+ Regex.match?(~r/[A-Z]/, password),
70
+ Regex.match?(~r/[a-z]/, password),
71
+ Regex.match?(~r/\d/, password),
72
+ Regex.match?(~r/[@#$%^_\-!(,)*]/, password)
73
+ ])
74
+ end
75
76
+ def validated_password?(_password), do: false
77
78
defp check_specific_characters?(input, allowed_chars) do
79
input
80
|> String.to_charlist()
0 commit comments