Skip to content

Instantly share code, notes, and snippets.

@nesterchung
Created March 22, 2012 11:29
Show Gist options
  • Save nesterchung/2157790 to your computer and use it in GitHub Desktop.
Save nesterchung/2157790 to your computer and use it in GitHub Desktop.
Javascript : Regex 6 < len < 10 , [a-zA-Z0-9]
function test(str) {
return /.*{6,10}/g.test(str) && !!~str.search(/[a-zA-Z]/) && !!~str.search(/\d/) && !~str.search(/\W/);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment