title: Regular expression to find an upper case and lower case letter in password for Android
body: <p>I need a regular expression to validate a password. The criteria is that the password should contain at least one upper case and one lower case letter. I want to use it with a pattern matcher in Android.</p>
  
  <p>Here is my attempt:</p>
  
  <pre><code>public static final String PWD_PATTERN_ALP_UP = "(?=.*[A-Z])(?=.*[a-z]).*"; 
  public static boolean isAlphabetPresent(String text) {
      Pattern pattern = Pattern.compile(
          Constants.PWD_PATTERN_ALP_UP,
          Pattern.CASE_INSENSITIVE);
      Matcher matcher = pattern.matcher(text); 
      return matcher.find();
  }
  </code></pre>