-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
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
Fix issues with emailRegexPattern. #1640
Conversation
The suggested solution by Diego was to make the limit 10, but making it unbounded probably makes more sense. It lets people use custom TLDs in local delivery / email testing without having to worry about length.
@@ -32,7 +32,7 @@ object ProtoRules extends Factory with LazyLoggable { | |||
* The regular expression pattern for matching email addresses. This | |||
* assumes that the email address has been converted to lower case. | |||
*/ | |||
val emailRegexPattern = new FactoryMaker(Pattern.compile("^[a-z0-9._%\\-+]+@(?:[a-z0-9\\-]+\\.)+[a-z]{2,4}$")) {} | |||
val emailRegexPattern = new FactoryMaker(Pattern.compile("(?i)^[a-z0-9._%\\-+]+@(?:[a-z0-9\\-]+\\.)+[a-z]{2,}$")) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be clearer if we want the insensitivity to apply throughout to apply it as the second flags parameter to compile
rather than in the regex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also need to fix the comment that indicates the email should be lowercase.
This should make the case insensitivity of the pattern more visible to someone else who is looking at the code.
All comments addressed. |
👍 |
@fmpwizard Why'd you move this to the M3 milestone? It looks like it's ready to go yeah? |
Oh 3.0-M2 already shipped. lol |
This resolve issues with emailRegexPattern not being up to date w.r.t. new TLDs longer than four characters and being case sensitive.
This resolve issues with
emailRegexPattern
not being up to date w.r.t. new TLDs longer than four characters. While I was in there I also made the matcher case insensitive.fixes #1634