Skip to content

Commit a14d310

Browse files
author
Steve Ayers
committed
Docs
1 parent 3aadd14 commit a14d310

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

protovalidate/internal/extra_func.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@ def is_ip_prefix(val: celtypes.Value, *args) -> celpy.Result:
145145

146146

147147
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+
148156
if not isinstance(string, celtypes.StringType):
149157
msg = "invalid argument, expected string"
150158
raise celpy.CELEvalError(msg)

0 commit comments

Comments
 (0)