shah_ankitb Posted November 19, 2009 Share Posted November 19, 2009 I'm looking for a javascript regular expression with the conditionMinimum 7 CharactersAtleast 1 NumberAtleast 1 Alphanumeric ofmeans when i enter "abcd111111#$@#$' then it should be valid. Link to comment Share on other sites More sharing options...
Redroest Posted November 19, 2009 Share Posted November 19, 2009 I asume you will use it or a password? var Regexp = /(\W+(.*)[0-9])|([0-9]+(.*)\W)/;if( (value1.length > 5) && (best.test(value1)) ){ //Special characters and integers are found alert("input valid");} Link to comment Share on other sites More sharing options...
shah_ankitb Posted November 19, 2009 Author Share Posted November 19, 2009 Thanks for reply, but still i'm looking for more.Minimum 7 CharactersIt' not working properly for "asdas111111"it should contian 1 number & 1 aplhanumeric characters among minimum 7 characters.I think i got it/^(?=.{7,}$)(?=.*[0-9])(?=.*[a-zA-Z]).*$/ Link to comment Share on other sites More sharing options...
thescientist Posted November 19, 2009 Share Posted November 19, 2009 aren't alpha numeric sets a combination of letters (A-Z) and numbers (0-9)?are you trying to force them to input a special character? i.e. @, $, #, etc? Link to comment Share on other sites More sharing options...
shah_ankitb Posted November 20, 2009 Author Share Posted November 20, 2009 aren't alpha numeric sets a combination of letters (A-Z) and numbers (0-9)?are you trying to force them to input a special character? i.e. @, $, #, etc?No i'm not forcing them to enter special characters, but if they want to enter then they can Link to comment Share on other sites More sharing options...
thescientist Posted November 20, 2009 Share Posted November 20, 2009 Sorry, I was confused by this it should contian 1 number & 1 aplhanumeric characters among minimum 7 characters.not sure myself. I was thinking that since a number was part of the alphanumeric set, that putting a number might count for two characters out of the 7; or that putting a number might count as 1 out of 7. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.