xxxxxxxxxx
function ValidateEmailAddress(emailString) {
// check for @ sign
var atSymbol = emailString.indexOf("@");
if(atSymbol < 1) return false;
var dot = emailString.indexOf(".");
if(dot <= atSymbol + 2) return false;
// check that the dot is not at the end
if (dot === emailString.length - 1) return false;
return true;
}
xxxxxxxxxx
function validateEmail(email) {
// Regular expression for basic email validation
const regex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
return regex.test(email);
}
// Example usage
const email1 = "test@example.com";
const email2 = "invalid-email";
console.log(validateEmail(email1)); // true
console.log(validateEmail(email2)); // false
xxxxxxxxxx
// Function to validate email address using regex pattern
function validateEmail(email) {
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return emailRegex.test(email);
}
// Example usage
const email = "example@example.com";
console.log(validateEmail(email)); // Output: true
xxxxxxxxxx
"The quiter you become the more you are able to hear!" take that with you in your journey! And remember hacking has no specific path, its the pation that makes you a hacker!