-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Validation] Issues with E-mail RegExp #3755
Comments
@paulborza Is it validating the full thing or is it validating Can you create an example case in jsfiddle? |
@Morrolan Here's the JS fiddle you asked for: https://jsfiddle.net/x0Lq0s8o/3/ You can reproduce the bug there per the 3-step instructions I've added. |
Thanks a lot for filing this issue, and including an easy to understand test case. I've added a milestone, and will try to take a look as soon as I can. |
This is a lot worse than just spaces. It appears to return true if a valid email is at least part of the string. Try It appears the regex is missing the start and end delimiters ('^' & '$'). Try
(I copied the code from the regex used in master) I haven't really done any further testing on this but that appears to solve the issue. I might work on PR for this and the requested "emails" validator this weekend. |
I'd accept a PR here. Regex's related to emails appear to have been solved in the completely generalized case literally nowhere on the internet. |
@jlukic Um, there are RegExes for this, but you don't want to build them by hand. The spec isn't easy to grasp so I'd suggest doing it the Perl way here. |
I will weigh on what I am using since I found the default one to be worthless a long time ago:
This was to fix the old rule only requiring an email in the string instead of being the entire string (ie: The first example at the top) as well as it fixed not allowing upper cases in emails. On a production site I haven't seen any issues from this regex in quite a while, though I doubt it solves all problems with the default regex. |
Fixed in #3955 with a reasonable email RegExp from @kevinresol. If there's any that don't pass that filter feel free to ping me. |
Try this email address
hajdu [email protected]
and it will validate fine according to Semantic UI, but the fact is that email address is invalid.The text was updated successfully, but these errors were encountered: