title: Regular expression with Password
body: <pre><code>var pattern = /^[a-zA-Z0-9!@#$%^&amp;*()~]+$/;
  
  var username = document.getelementbyId("txtUsername").value;
  
  if(pattern.test(username) == false) {
  
      alert("Invalid Username");
  }
  </code></pre>
  
  <p>The above regex pattern  is not working.
  I want a Regular expression where the password must contain at least one lowercase letter, one Uppercase letter, one digit and one special character. </p>