function checkEmail(str){ var emailCheck = /[^a-z][0-9]/; if(emailCheck.test(str)){ console.log("**Its Valid Mail"); } else{ console.log("Its not Valid"); } } var x = '122a'; checkEmail(x); I have been learning Regular Expressions. From the above code what I understand, x should not contain small a-z and it must contain number, as you can see 122a contains number as well as small letter a, I think it should be invalid but yet I get it as valid. Can anyone please explain where I am thinking wrong.