Skip to main content
Format code
Source Link
Mamun
  • 69k
  • 9
  • 51
  • 62
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.

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.

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.

deleted 6 characters in body
Source Link
Mamun
  • 69k
  • 9
  • 51
  • 62
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,. fromFrom the above code what I understand is the, 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.

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 is the 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.

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.

deleted 16 characters in body; edited title
Source Link
Mamun
  • 69k
  • 9
  • 51
  • 62

Regular expressions [^a-z][0-9] in javascriptJavaScript

<script> 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); 

So guys iI have been learning Regular expressionsExpressions,F Fromfrom the above code what iI understand is the "x"x should not contain small a-za-z and it must contain number, as you can see "122a"122a contains number as well as small letter "a"a, iI think it should be invalid but yet iI get it as Validvalid. Can anyone plzplease explain this orwhere I am i thinking it wrong.

Regular expressions [^a-z][0-9] in javascript

<script> 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); 

So guys i have been learning Regular expressions,F From the above code what i understand is the "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 plz explain this or am i thinking it wrong

Regular expressions [^a-z][0-9] in JavaScript

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 is the 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.

edited title
Link
soorapadman
  • 4.5k
  • 7
  • 38
  • 49
Loading
Source Link
JustaGamer
  • 79
  • 2
  • 2
  • 9
Loading