Closed mattwelke closed 1 year ago
This would be a bug - PR is welcome to fix. Typically though we would toLowerCase()
before running against this.
@titanism Would lowercasing input before validating using this be a good workaround? In the library I maintain, we could do this as a workaround, if I struggle to get a PR in here.
Yes that's what we do
Describe the bug
Node.js version: Node.js 18
OS version: Ubuntu 22.04
Description:
When changing the Gmail mode from its default
true
tofalse
, the regex produced considers email addresses with capital letters invalid. I think email addresses that have capital letters are valid because apparently modern email servers ignore case.Can you clarify? Is this a bug or intended behavior? If intended, why?
Actual behavior
Regex produced with
gmail: false
in config considers emails invalid if they have a capital letter.Expected behavior
Regex produced with
gmail: false
in config does not consider emails invalid if they have a capital letter.Code to reproduce
Use this code to get the regex:
(can console log it etc)
Or, check out the latest commit in the branch in the repo for an open source lib I maintain at https://github.com/schema-inspector/schema-inspector/pull/143. One of our unit tests is failing with candidate "nikitaJS@pantera.com" when I change to the new regex.
Checklist