title: How can I use Pattern and Matcher with StringBuffer or char[] types instead of String?
body: <p>How can I use a method like this</p>
  <pre><code>private boolean respectPattern(String password) {
    Pattern passwordPattern = Pattern.compile(
      &quot;^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[.@$!%*?&amp;])[A-Za-z\\d@$!%*?&amp;.]{8,}$&quot;,
      Pattern.CASE_INSENSITIVE);
    Matcher matcher = passwordPattern.matcher(password);
    return matcher.find();
  }
  </code></pre>
  <p>If I replace <code>password</code> type with <code>StringBuffer</code> or <code>char[]</code>?</p>