I'm familiar only with regex when validating strings of data. What I'm trying to do, is validate a specific email address when creating a user in Firebase.
auth.createUserWithEmailAndPassword
btnSignUp.addEventListener('click', e => {
// Get email and pass
const email = txtEmail.value;
const pass = txtPassword.value;
const auth = firebase.auth();
// Sign in
const promise = auth.createUserWithEmailAndPassword(email, pass);
});
How can I validate the email that is passed through the EventListener and make sure it matches a specific email address (ex. gmail.com)?