title: How to validate password length and regex same time
body: <p>I'm using <code>yup</code> for validation, it look like this</p>
  <pre><code>export const signinSchema = yupResolver(
    yup.object().shape({
      username: yup.string().required(&quot;Email is a required field.&quot;),
      password: yup
        .string()
        .required(&quot;Password is a required field.&quot;)
        .matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@#$%^&amp;+=])/, {
          message:
            &quot;Password must be at least one uppercase, one lowercase, one special character and one number.&quot;,
        })
        .min(8, &quot;Password must be at least 8 charaters.&quot;),
    }),
  )
  </code></pre>
  <p>But i wonder can we validate password length ( <code>.min(8, &quot;Password must be at least 8 charaters.&quot;</code> ) and regex (</p>
  <pre><code>.matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@#$%^&amp;+=])/, {
          message:
            &quot;Password must be at least one uppercase, one lowercase, one special character and one number.&quot;,
        })
  </code></pre>
  <p><strong>At the same time?? like combine two condition into one</strong></p>
  <p>Thank you guy a lot</p>