Regular expression: ((?=.*\d)(?=.*[A-Z]))
Input string: qwer1Q
The input string above pass the validation if you check it in regex101
However, if you include the regex in a html pattern
attribute and try to validate the same string again, it shall not pass:
<form>
<div>
<input type="text" placeholder="Password"
pattern="((?=.*\d)(?=.*[A-Z]))">
</div>
<div>
<button>Submit</button>
</div>
</form>