title: java regex match for alphanumeric string
body: <p>I am trying to check whether a password is alphanumeric or not using regex
  but I am not getting the result I expect. What is the problem with the below code?</p>
  
  <pre><code>boolean passwordOnlyAlphaNumericCheck = false;
  Pattern patternAlphaNumericCheck = Pattern.compile("^[a-zA-Z0-9]$");
  Matcher matcherAlphaNumericCheck = patternAlphaNumericCheck.matcher(login.getPassword());
  if(matcherAlphaNumericCheck.find())
    passwordOnlyAlphaNumericCheck = true;
  </code></pre>
  
  <p>Thanks for help</p>