-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Labels
BugSomething isn't workingSomething isn't working
Description
Description
The regex that is used to check email addresses does not support unicode local parts. RFC 6532 allows for unicode characters in the local part of the email address, which are not supported by this regex.
For example: Muñ[email protected]
emailRegex = regexp.MustCompile("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$")
Steps to Reproduce
Attempt to validate any email address that has a unicode character in the local part.
Expected Behavior
I would expect that the behavior to be consistent between ParseAddress() and isEmail since they're doing the same thing.
Actual Behavior
Received error email: value must be a valid email address [string.email]
Screenshots/Logs
n/a
Environment
- Operating System:
- Version:
- Compiler/Toolchain:
- Protobuf Compiler & Version:
- Protovalidate Version: v0.14.0
Possible Solution
isEmail() should use the builtin email validation.
Additional Context
Metadata
Metadata
Assignees
Labels
BugSomething isn't workingSomething isn't working