title: Java regex require at least one letter and one digit. Also allow any special characters
body: <p>I tried searching for a regex which can validate if a string contains at least one letter and one digit and there can be any special character as well with a minimum 8 length. </p>
  
  <p>I tried below regex but it checking  </p>
  
  <ul>
  <li>One digit</li>
  <li>One letter</li>
  <li><p>@ and - special symbol</p>
  
  <pre><code>(?=(?:.*[a-zA-Z]){1,})(?=(?:.*[@-]){0,})(?=(?:.*[0-9]){1,})^[a-zA-Z0-9@-]*$
  </code></pre></li>
  </ul>
  
  <p>But I want it can allow any special characters (Special chars are optional but at least one letter and one digit must be there in string.)</p>