We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3aadd14 commit a14d310Copy full SHA for a14d310
1 file changed
protovalidate/internal/extra_func.py
@@ -145,6 +145,14 @@ def is_ip_prefix(val: celtypes.Value, *args) -> celpy.Result:
145
146
147
def is_email(string: celtypes.Value) -> celpy.Result:
148
+ """Returns true if the string is an email address, for example "foo@example.com".
149
+
150
+ Conforms to the definition for a valid email address from the HTML standard.
151
+ Note that this standard willfully deviates from RFC 5322, which allows many
152
+ unexpected forms of email addresses and will easily match a typographical
153
+ error.
154
+ """
155
156
if not isinstance(string, celtypes.StringType):
157
msg = "invalid argument, expected string"
158
raise celpy.CELEvalError(msg)
0 commit comments