title: Angular RegEx pattern for password validation
body: <p><strong>Requirement:</strong></p>
  
  <p>In my angular application, users password should match below requirement,</p>
  
  <ul>
  <li>Minimum eight characters </li>
  <li>At least one uppercase letter</li>
  <li>At least one lowercase letter</li>
  <li>At least one number</li>
  <li>At least one special character</li>
  </ul>
  
  <p><strong>Issue:</strong></p>
  
  <p>For the above requirement, I'm using below Regular Expression.</p>
  
  <pre><code>^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[$@$!%*?&amp;])[A-Za-z\d$@$!%*?&amp;].{8,}$
  </code></pre>
  
  <p>My code as below,
  <a href="https://i.stack.imgur.com/sYvlh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sYvlh.png" alt="enter image description here"></a>
  <strong>The issue was this return as invalid if a password starts with a number.</strong></p>
  
  <p>Ex: 1F4@sf5s6,18F4@sf5s6</p>
  
  <p><strong>Question:</strong></p>
  
  <p><strong>Q1:</strong> Is this RegEx not match with my requirement?</p>
  
  <p><strong>Q2:</strong> How to fix this?</p>
  
  <p><strong>Q3:</strong> Is there another way to implement this requirement?</p>