{"ScriptPreparationCode":"var tester = /^[-!#$%\u0026\u0027*\u002B\\/0-9=?A-Z^_a-z\u0060{|}~](\\.?[-!#$%\u0026\u0027*\u002B\\/0-9=?A-Z^_a-z\u0060{|}~])*@[a-zA-Z0-9](-*\\.?[a-zA-Z0-9])*\\.[a-zA-Z](-?[a-zA-Z0-9])\u002B$/;\r\n\r\nvar testEmails = [\r\n\t\u0022abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@letters-in-local.org\u0022,\r\n\t\u002201234567890@numbers-in-local.net\u0022,\r\n\t\u0022\u0026\u0027*\u002B-./=?^_{}~@other-valid-characters-in-local.net\u0022,\r\n\t\u0022mixed-1234-in-{\u002B^}-local@sld.net\u0022,\r\n\t\u0022a@single-character-in-local.org\u0022,\r\n\t\u0022one-character-third-level@a.example.com\u0022,\r\n\t\u0022single-character-in-sld@x.org\u0022,\r\n\t\u0022local@dash-in-sld.com\u0022,\r\n\t\u0022letters-in-sld@123.com\u0022,\r\n\t\u0022one-letter-sld@x.org\u0022,\r\n\t\u0022test@test--1.com\u0022,\r\n\t\u0022uncommon-tld@sld.museum\u0022,\r\n\t\u0022uncommon-tld@sld.travel\u0022,\r\n\t\u0022uncommon-tld@sld.mobi\u0022,\r\n\t\u0022country-code-tld@sld.uk\u0022,\r\n\t\u0022country-code-tld@sld.rw\u0022,\r\n\t\u0022local@sld.newTLD\u0022,\r\n\t\u0022the-total-length@of-an-entire-address.cannot-be-longer-than-two-hundred-and-fifty-four-characters.and-this-address-is-254-characters-exactly.so-it-should-be-valid.and-im-going-to-add-some-more-words-here.to-increase-the-length-blah-blah-blah-blah-bla.org\u0022,\r\n\t\u0022the-character-limit@for-each-part.of-the-domain.is-sixty-three-characters.this-is-exactly-sixty-three-characters-so-it-is-valid-blah-blah.com\u0022,\r\n\t\u0022local@sub.domains.com\u0022,\r\n\t\u0022backticks\u0060are\u0060legit@test.com\u0022,\r\n\t\u0022digit-only-domain@123.com\u0022,\r\n\t\u0022digit-only-domain-with-subdomain@sub.123.com\u0022,\r\n\t\u0022\u0060a@a.fr\u0022,\r\n\t\u0022\u0060aa@fr.com\u0022,\r\n\t\u0022com@sil.c1m\u0022,\r\n\t\u0022t119037jskc_ihndkdoz@aakctgajathzffcsuqyjhgjuxnuulgnhxtnbquwtgxljfayeestsjdbalthtddy.lgtmsdhywswlameglunsaplsblljavswxrltovagexhtttodqedmicsekvpmpuu.pgjvdmvzyltpixvalfbktnnpjyjqswbfvtpbfsngqtmhgamhrbqqvyvlhqigggv.nxqglspfbwdhtfpibcrccvctmoxuxwlunghhwacjtrclgirrgppvshxvrzkoifl\u0022,\r\n\t\u0022\\\u0022quoted\\\u0022@sld.com\u0022,\r\n\t\u0022\\\u0022\\\\e\\\\s\\\\c\\\\a\\\\p\\\\e\\\\d\\\u0022@sld.com\u0022,\r\n\t\u0022\\\u0022quoted-at-sign@sld.org\\\u0022@sld.com\u0022,\r\n\t\u0022\\\u0022escaped\\\\\\\u0022quote\\\u0022@sld.com\u0022,\r\n\t\u0022\\\u0022back\\\\slash\\\u0022@sld.com\u0022,\r\n\t\u0022punycode-numbers-in-tld@sld.xn--3e0b707e\u0022,\r\n\t\u0022bracketed-IP-instead-of-domain@[127.0.0.1]\u0022,\r\n\t\u0022@missing-local.org\u0022,\r\n\t\u0022! #$%\u0060|@invalid-characters-in-local.org\u0022,\r\n\t\u0022(),:;\u0060|@more-invalid-characters-in-local.org\u0022,\r\n\t\u0022\u003C\u003E@[]\\\\\u0060|@even-more-invalid-characters-in-local.org\u0022,\r\n\t\u0022.local-starts-with-dot@sld.com\u0022,\r\n\t\u0022local-ends-with-dot.@sld.com\u0022,\r\n\t\u0022two..consecutive-dots@sld.com\u0022,\r\n\t\u0022partially.\\\u0022quoted\\\u0022@sld.com\u0022,\r\n\t\u0022the-local-part-is-invalid-if-it-is-longer-than-sixty-four-characters@sld.net\u0022,\r\n\t\u0022missing-sld@.com\u0022,\r\n\t\u0022sld-starts-with-dashsh@-sld.com\u0022,\r\n\t\u0022sld-ends-with-dash@sld-.com\u0022,\r\n\t\u0022invalid-characters-in-sld@! \\\u0022#$%(),/;\u003C\u003E_[]\u0060|.org\u0022,\r\n\t\u0022missing-dot-before-tld@com\u0022,\r\n\t\u0022missing-tld@sld.\u0022,\r\n\t\u0022invalid\u0022,\r\n\t\u0022the-total-length@of-an-entire-address.cannot-be-longer-than-two-hundred-and-fifty-six-characters.and-this-address-is-257-characters-exactly.so-it-should-be-invalid.and-im-going-to-add-some-more-words-here.to-increase-the-length-blah-blah-blah-blah-blah-.org\u0022,\r\n\t\u0022the-character-limit@for-each-part.of-the-domain.is-sixty-three-characters.this-is-exactly-sixty-four-characters-so-it-is-invalid-blah-blah.com\u0022,\r\n\t\u0022missing-at-sign.net\u0022,\r\n\t\u0022unbracketed-IP@127.0.0.1\u0022,\r\n\t\u0022invalid-ip@127.0.0.1.26\u0022,\r\n\t\u0022another-invalid-ip@127.0.0.256\u0022,\r\n\t\u0022IP-and-port@127.0.0.1:25\u0022,\r\n\t\u0022trailing-dots@test.de.\u0022,\r\n\t\u0022dot-on-dot-in-domainname@te..st.de\u0022,\r\n\t\u0022dot-first-in-domain@.test.de\u0022,\r\n\t\u0022mg@ns.i\u0022,\r\n\t\u0022.dot-start-and-end.@sil.com\u0022,\r\n\t\u0022double@a@com\u0022,\r\n\t\u0022\u0022,\r\n\t\u0022tr119037jskc_ihndkdoz@d.aakctgajathzffcsuqyjhgjuxnuulgnhxtnbquwtgxljfayeestsjdbalthtddy.lgtmsdhywswlameglunsaplsblljavswxrltovagexhtttodqedmicsekvpmpuu.pgjvdmvzyltpixvalfbktnnpjyjqswbfvtpbfsngqtmhgamhrbqqvyvlhqigggv.nxqglspfbwdhtfpibcrccvctmoxuxwlunghhwacjtrclgirrgppvshxvrzkoifl\u0022,\r\n];","TestCases":[{"Name":"Proposed change","Code":"testEmails.forEach(\r\n (email) =\u003E {\r\n if (!email) return false;\r\n\r\n if (!tester.test(email)) return false;\r\n\r\n var emailParts = email.split(\u0027@\u0027);\r\n\r\n var account = emailParts[0];\r\n var address = emailParts[1];\r\n\r\n if (account.length \u003E 64) return false;\r\n\r\n else if (address.length \u003E 255) return false;\r\n\r\n var domainParts = address.split(\u0027.\u0027);\r\n\r\n if (domainParts.some(function (part) {\r\n return part.length \u003E 63;\r\n })) return false;\r\n\r\n return true;\r\n }\r\n )","IsDeferred":false},{"Name":"Existing code","Code":"testEmails.forEach(\r\n (email) =\u003E {\r\n if (!email) return false;\r\n\r\n var emailParts = email.split(\u0027@\u0027);\r\n\r\n if (emailParts.length !== 2) return false;\r\n\r\n var account = emailParts[0];\r\n var address = emailParts[1];\r\n\r\n if (account.length \u003E 64) return false;\r\n\r\n else if (address.length \u003E 255) return false;\r\n\r\n var domainParts = address.split(\u0027.\u0027);\r\n\r\n if (domainParts.some(function (part) {\r\n return part.length \u003E 63;\r\n })) return false;\r\n\r\n return tester.test(email);\r\n }\r\n )","IsDeferred":false}]}