Open smvilar opened 8 years ago
This library seems quite loose in terms of matching email patterns, is that correct? As I can see in the tests that !#$%&
*+/=?^{|}~@sindresorhus.com
for example is an exact match. So if special characters like that are allowed but <foo@bar.com>
isn't, what about the following situations
<foo@bar.com
foo@bar.com>
foo<bar@bar.com
<foo>@bar.com
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 'text@example.com, some text'
will return 'text@example.com,'
with the comma
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 someName@someDomain.tld
, but also someName<someName@someDomain.tld>
, so this issue is not really an issue.
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 I am on Angular
And using the below regex:
'^[a-z0-9]+([._-]?[a-z0-9]+)+@[a-z0-9]+([._-]?[a-z0-9]+)+\\.[a-z]{2,3}$'
But its not fulfilling my requirement, my requirement is below:
saa5@me-d_d_u.co
please anyone tell me, why this regex is not working for my above mentioned case.
Regards Babar Ali Shah
emailRegex({exact:true}).test('<foo@bar.com>') // true :(