@sparser/email-address-parser-regex
v3.0.0-rc.5
Published
Regex-based RFC 5322 and RFC 6532 email address parser.
Maintainers
Readme
@sparser/email-address-parser-regex
Regex-based RFC 5322 and RFC 6532 compliant email address parser.
Install
npm install @sparser/email-address-parser-regexUsage
import { EmailAddress, ParsingOptions } from "@sparser/email-address-parser-regex";
const email = EmailAddress.parse("[email protected]");
console.log(email?.localPart); // foo
console.log(email?.domain); // bar.com
const isValid = EmailAddress.isValid("[email protected]", new ParsingOptions(false));
console.log(isValid); // trueAdvanced regex exports are available from:
import { EMAIL_REGEX_STRICT, isValidEmail, parseEmail } from "@sparser/email-address-parser-regex/email-regex";