-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
This string passes as an exact match: '<[email protected]>' #2
Comments
This library seems quite loose in terms of matching email patterns, is that correct? As I can see in the tests that
Just so I can expand the test cases and make sure the correct situations are covered. |
I have the same issue, many false positive are found. |
matching against |
I would like to use this module in my app - but I am finding that it returns some inconsistent results. Assuming this gist is a proper list of valid and invalid emails for testing: https://gist.github.com/cjaoude/fd9910626629b53c4d25 It does not seem to match correctly. The link above has 37 email addresses to test with - 17 are valid, 20 are invalid. Testing with this package results in 35 valid email addresses when I think it should only return 20. It matches the following emails correctly:
It properly ignored these emails:
It errored on the following ones:
|
I know that this is issue may be old but according to the RFC-822 on the Address Specification, the regex behaves correctly with the given test, that is because email addresses are not only limited to the format |
This is definitely an issue/bug. emailRegex().test('f@il') // => true Version 3.0.0 |
@wmik Emails are not required to have a domain. You can find domain-less email on company intranets. We could add an option to require this however, as I agree it's not useful to allow domain-less emails for public services. |
Please check, my regExp(https://regex101.com/r/YrpDBq/7) maybe it will help, only thing is left company emails |
I have published https://github.com/niftylettuce/email-regex-safe as an alternative to this package, with a lot of configurable options. PR's welcome. |
Hi And using the below regex:
But its not fulfilling my requirement, my requirement is below:
please anyone tell me, why this regex is not working for my above mentioned case. Regards |
emailRegex({exact:true}).test('<[email protected]>') // true :(
The text was updated successfully, but these errors were encountered: