Email fix for #3755 #3955

Merged
merged 2 commits into from Apr 28, 2016

Projects

None yet

3 participants

@ScopeyNZ
Contributor

In the end I did a bit of research and borrowed the email regex used in angular.js.

@kevinresol
kevinresol commented Apr 26, 2016 edited

Seems that this regexp is more accurate: (I forgot the source though)

/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i

Examples: http://try.haxe.org/#0B65c

@jlukic
Member
jlukic commented Apr 28, 2016

If it works for angular it works for me

@kevinresol If you can qualify the differences in your regex I would consider.

@jlukic jlukic merged commit 92c1cd1 into Semantic-Org:next Apr 28, 2016
@jlukic
Member
jlukic commented Apr 28, 2016 edited

Added rlsnotes af7fcf6

@jlukic jlukic added this to the 2.1.9 milestone Apr 28, 2016
@kevinresol

@jlukic in the link I posted previously you can press "Build + Run" to try it.

You should be able to notice that k.@cc.com is considered as valid email address by angular's regex while it should not be. And my suggested regex correctly recognize that.

@jlukic jlukic modified the milestone: 2.1.9, 2.2 May 1, 2016
@ScopeyNZ ScopeyNZ deleted the ScopeyNZ:email-fix branch May 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment