79397239

Date: 2025-01-29 15:24:32
Score: 0.5
Natty:
Report link

function getEmailFromText(text){
    const has = text.includes("@");
    const left = text.split("@")[0];
    const right = text.split("@")[1];
    const email = has ? `${left.split(" ")[(left.split(" ").length-1)]}@${right.split(" ")[0]}` : "";
    const re_email = email.match(/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g);
    return re_email ? re_email[0] : "";
}

console.log(getEmailFromText("Contact me on: [email protected] other other..."));

Reasons:
  • Blacklisted phrase (0.5): Contact me
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Rahman Qadirzade